Class: Stannp::List

Inherits:
Object
  • Object
show all
Defined in:
lib/stannp/list.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:) ⇒ List

Returns a new instance of List.



11
12
13
# File 'lib/stannp/list.rb', line 11

def initialize(data:)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/stannp/list.rb', line 5

def data
  @data
end

Class Method Details

.from_request(data:, type:) ⇒ Object



7
8
9
# File 'lib/stannp/list.rb', line 7

def self.from_request(data:, type:)
  new(data: data.map { |attrs| type.new(attrs) })
end