Class: Starry::Item
- Inherits:
-
Object
- Object
- Starry::Item
- Defined in:
- lib/starry/item.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 = {}) ⇒ Item
constructor
A new instance of Item.
- #to_s ⇒ Object
Constructor Details
#initialize(value, parameters = {}) ⇒ Item
Returns a new instance of Item.
5 6 7 8 |
# File 'lib/starry/item.rb', line 5 def initialize(value, parameters = {}) @value = value @parameters = parameters end |
Instance Attribute Details
#parameters ⇒ Object
Returns the value of attribute parameters.
3 4 5 |
# File 'lib/starry/item.rb', line 3 def parameters @parameters end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/starry/item.rb', line 3 def value @value end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 |
# File 'lib/starry/item.rb', line 10 def ==(other) self.class == other.class && self.value == other.value && self.parameters == other.parameters end |
#deconstruct_keys(keys) ⇒ Object
18 19 20 |
# File 'lib/starry/item.rb', line 18 def deconstruct_keys(keys) { value: @value, parameters: @parameters } end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/starry/item.rb', line 14 def to_s "#{ Starry.(value) }#{ Starry.serialize_parameters(parameters) }" end |