Class: Autoini::Pair
- Inherits:
-
AbstractLine
- Object
- Element
- AbstractLine
- Autoini::Pair
- Includes:
- InlineComment
- Defined in:
- lib/autoini/pair.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes included from InlineComment
Class Method Summary collapse
Instance Method Summary collapse
- #==(e) ⇒ Object
-
#initialize(key, value) ⇒ Pair
constructor
A new instance of Pair.
- #to_a ⇒ Object
- #to_s ⇒ Object
Methods included from InlineComment
Constructor Details
#initialize(key, value) ⇒ Pair
Returns a new instance of Pair.
7 8 9 10 |
# File 'lib/autoini/pair.rb', line 7 def initialize(key, value) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
5 6 7 |
# File 'lib/autoini/pair.rb', line 5 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/autoini/pair.rb', line 5 def value @value end |
Class Method Details
Instance Method Details
#==(e) ⇒ Object
20 21 22 |
# File 'lib/autoini/pair.rb', line 20 def ==(e) e.is_a?(Pair) && e.key == key && e.value == value && e.comment == comment end |
#to_a ⇒ Object
16 17 18 |
# File 'lib/autoini/pair.rb', line 16 def to_a [key.to_sym, value] end |