Sha256: 19654ce708191effd15071f503ea61be1bba850280adb9242ecd02d4d83b432a
Contents?: true
Size: 588 Bytes
Versions: 3
Compression:
Stored size: 588 Bytes
Contents
module Languages module Generic class Dots def initialize(int) @int = int end def to_i @int end def +(other) self.class.new(@int + value_of(other)) end def -(other) self.class.new(@int - value_of(other)) end def ==(other) @int == value_of(other) end def to_dots self end def to_s @int.to_s end private def value_of(other) v = other.respond_to?(:to_dots) ? other.to_dots.to_i : other.to_i end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
zebra_printer-0.9.0 | lib/languages/generic/dots.rb |
zebra_printer-0.8.0 | lib/languages/generic/dots.rb |
zebra_printer-0.1.1 | lib/languages/generic/dots.rb |