Class: Starry::InnerList

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/starry/inner_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#parametersObject

Returns the value of attribute parameters.



5
6
7
# File 'lib/starry/inner_list.rb', line 5

def parameters
  @parameters
end

#valueObject

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_sObject



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