Sha256: 9b4793daaf5c173eef69ae040dc4b9701d58558c4a3f9d613f786ee7243c354c

Contents?: true

Size: 216 Bytes

Versions: 4

Compression:

Stored size: 216 Bytes

Contents

module Danconia
  Pair = Struct.new(:from, :to) do
    def self.parse str
      new str[0..2], str[3..-1]
    end

    def invert
      Pair.new to, from
    end

    def to_s
      [from, to].join
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
danconia-0.4.0 lib/danconia/pair.rb
danconia-0.3.1 lib/danconia/pair.rb
danconia-0.3.0 lib/danconia/pair.rb
danconia-0.2.9 lib/danconia/pair.rb