Class: Starry::InnerList
- Inherits:
-
Object
- Object
- Starry::InnerList
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/starry/inner_list.rb
Instance Attribute Summary collapse
-
#parameters ⇒ Object
Returns the value of attribute parameters.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value = [], parameters = {}) ⇒ InnerList
constructor
A new instance of InnerList.
- #to_s ⇒ Object
Constructor Details
#initialize(value = [], parameters = {}) ⇒ InnerList
Returns a new instance of InnerList.
11 12 13 14 |
# File 'lib/starry/inner_list.rb', line 11 def initialize(value = [], parameters = {}) @value = value @parameters = parameters end |
Instance Attribute Details
#parameters ⇒ Object
Returns the value of attribute parameters.
5 6 7 |
# File 'lib/starry/inner_list.rb', line 5 def parameters @parameters end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/starry/inner_list.rb', line 5 def value @value end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 |
# File 'lib/starry/inner_list.rb', line 16 def ==(other) self.class == other.class && self.value == other.value && self.parameters == other.parameters end |
#deconstruct_keys(keys) ⇒ Object
29 30 31 |
# File 'lib/starry/inner_list.rb', line 29 def deconstruct_keys(keys) { value: @value, parameters: @parameters } end |
#to_s ⇒ Object
20 21 22 23 24 25 |
# File 'lib/starry/inner_list.rb', line 20 def to_s members = self.map do |item| Starry.serialize_item(item) end "(#{ members.join(' ') })#{ Starry.serialize_parameters(parameters) }" end |