Sha256: 3525e2b418da71fa7ba315d5c748f05faa776f433d132c33e91314eece967ab4

Contents?: true

Size: 420 Bytes

Versions: 2

Compression:

Stored size: 420 Bytes

Contents

module Chemistry
  module Temperature
    class Unit
      def initialize(temperature)
        @temperature = temperature
      end

      def to_i
        @temperature.to_i
      end

      def to_f
        @temperature.to_f
      end

      def ==(other)
        if other.kind_of? Chemistry::Temperature::Unit
          to_kelvin == other.to_kelvin
        else
          false
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chemistry-temperature-1.0.1 lib/chemistry/temperature/unit.rb
chemistry-temperature-1.0.0 lib/chemistry/temperature/unit.rb