Class: Danconia::Pair
- Inherits:
-
Struct
- Object
- Struct
- Danconia::Pair
- Defined in:
- lib/danconia/pair.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from
2 3 4 |
# File 'lib/danconia/pair.rb', line 2 def from @from end |
#to ⇒ Object
Returns the value of attribute to
2 3 4 |
# File 'lib/danconia/pair.rb', line 2 def to @to end |
Class Method Details
.parse(str) ⇒ Object
3 4 5 |
# File 'lib/danconia/pair.rb', line 3 def self.parse str new str[0..2], str[3..-1] end |
Instance Method Details
#invert ⇒ Object
7 8 9 |
# File 'lib/danconia/pair.rb', line 7 def invert Pair.new to, from end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/danconia/pair.rb', line 11 def to_s [from, to].join end |