class SantanderChile::ApiClient::Collection

Attributes

data[R]

Public Class Methods

from_response(response, dig_keys:, type:) click to toggle source
# File lib/santander_chile/api_client/collection.rb, line 11
def self.from_response(response, dig_keys:, type:)
  body = response.body
  new(
    data: body.dig(*dig_keys).map {
      |attrs|
      type.new(attrs)
    },
  )
end
new(data:) click to toggle source
# File lib/santander_chile/api_client/collection.rb, line 7
def initialize(data:)
  @data = data
end

Public Instance Methods

each(*args, &block) click to toggle source
# File lib/santander_chile/api_client/collection.rb, line 21
def each(*args, &block)
  @data.each(*args, &block)
end