class Converter
Attributes
temperatureInCelcius[R]
value[RW]
Public Class Methods
new(value, temperatureInCelcius)
click to toggle source
# File lib/Convert.rb, line 6 def initialize(value, temperatureInCelcius) @value = value @temperatureInCelcius = temperatureInCelcius end
Public Instance Methods
unit=(unit)
click to toggle source
# File lib/Convert.rb, line 11 def unit= (unit) case unit when "C" @temperatureInCelcius = value when "F" @temperatureInCelcius = FahrenheidToCelcius.convert(value) when "K" @temperatureInCelcius = KelvinToCelcius.convert(value) else @temperatureInCelcius = "not a correct value" end end