Class: Array::Tag
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(key, value = nil) ⇒ Tag
constructor
A new instance of Tag.
- #to_s ⇒ Object (also: #inspect)
- #untagged ⇒ Object
Constructor Details
#initialize(key, value = nil) ⇒ Tag
Returns a new instance of Tag.
7 8 9 10 |
# File 'lib/andromeda/patch/array_bin_search.rb', line 7 def initialize(key, value = nil) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
4 5 6 |
# File 'lib/andromeda/patch/array_bin_search.rb', line 4 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/andromeda/patch/array_bin_search.rb', line 5 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
14 15 16 |
# File 'lib/andromeda/patch/array_bin_search.rb', line 14 def <=>(other) return key <=> other.key end |
#to_s ⇒ Object Also known as: inspect
18 19 20 |
# File 'lib/andromeda/patch/array_bin_search.rb', line 18 def to_s "Tag(#{key.to_s} => #{value.to_s})" end |
#untagged ⇒ Object
12 |
# File 'lib/andromeda/patch/array_bin_search.rb', line 12 def untagged ; value end |