Class: Danconia::Pair

Inherits:
Struct
  • Object
show all
Defined in:
lib/danconia/pair.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fromObject

Returns the value of attribute from

Returns:

  • (Object)

    the current value of from



2
3
4
# File 'lib/danconia/pair.rb', line 2

def from
  @from
end

#toObject

Returns the value of attribute to

Returns:

  • (Object)

    the current value of 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

#invertObject



7
8
9
# File 'lib/danconia/pair.rb', line 7

def invert
  Pair.new to, from
end

#to_sObject



11
12
13
# File 'lib/danconia/pair.rb', line 11

def to_s
  [from, to].join
end