Class: LHC::Response::Data::Collection

Inherits:
Array
  • Object
show all
Includes:
Base
Defined in:
lib/lhc/response/data/collection.rb

Instance Method Summary collapse

Methods included from Base

#as_json, #as_open_struct

Constructor Details

#initialize(response, data: nil) ⇒ Collection

Returns a new instance of Collection.


6
7
8
9
10
11
12
13
14
15
# File 'lib/lhc/response/data/collection.rb', line 6

def initialize(response, data: nil)
  @response = response
  @data = data

  super(
    as_json.map do |i|
      LHC::Response::Data.new(response, data: i)
    end
  )
end