Class: C11n::Conversion::Serializer::Pair
- Inherits:
-
Object
- Object
- C11n::Conversion::Serializer::Pair
- Defined in:
- lib/c11n/conversion/serializer.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(another) ⇒ Object
-
#initialize(key, value) ⇒ Pair
constructor
A new instance of Pair.
- #to_a ⇒ Object
Constructor Details
#initialize(key, value) ⇒ Pair
Returns a new instance of Pair.
8 9 10 11 |
# File 'lib/c11n/conversion/serializer.rb', line 8 def initialize(key, value) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/c11n/conversion/serializer.rb', line 6 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/c11n/conversion/serializer.rb', line 6 def value @value end |
Instance Method Details
#==(another) ⇒ Object
17 18 19 |
# File 'lib/c11n/conversion/serializer.rb', line 17 def ==(another) another.key == @key && another.value == @value end |
#to_a ⇒ Object
13 14 15 |
# File 'lib/c11n/conversion/serializer.rb', line 13 def to_a [@key, @value] end |