Class: C11n::Conversion::Serializer::Pair

Inherits:
Object
  • Object
show all
Defined in:
lib/c11n/conversion/serializer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject

Returns the value of attribute key.



6
7
8
# File 'lib/c11n/conversion/serializer.rb', line 6

def key
  @key
end

#valueObject

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_aObject



13
14
15
# File 'lib/c11n/conversion/serializer.rb', line 13

def to_a
  [@key, @value]
end