Class: Stannp::List
- Inherits:
-
Object
- Object
- Stannp::List
- Defined in:
- lib/stannp/list.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data:) ⇒ List
constructor
A new instance of List.
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
#data ⇒ Object (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 |