Sha256: 00a6369655dfacb743f8a5ea9e26b0a54ce9f38d0b0ba820908faaacb5084759

Contents?: true

Size: 662 Bytes

Versions: 1

Compression:

Stored size: 662 Bytes

Contents

require 'chemistry/temperature/kelvin'
require 'chemistry/temperature/fahrenheit'
require 'chemistry/temperature/celsius'

module Chemistry
  class Temperature
    class << self
      def kelvin(temperature)
        Chemistry::Temperature::Kelvin.new(temperature)
      end

      def celsius(temperature)
        Chemistry::Temperature::Celsius.new(temperature)
      end

      def fahrenheit(temperature)
        Chemistry::Temperature::Fahrenheit.new(temperature)
      end
    end

    def initialize(temperature)
      @temperature = temperature
    end

    def to_i
      @temperature.to_i
    end

    def to_f
      @temperature.to_f
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chemistry-0.0.3 lib/chemistry/temperature.rb