class Text
Attributes
opt[R]
temperature[R]
Public Class Methods
new(value_te,opt)
click to toggle source
Constructor that it passes by parameter the hash opt and a value to calculate the temperature that the hash opt to include (temperature)
# File lib/text.rb, line 6 def initialize(value_te,opt) @temperature=temperature @opt = opt end
Public Instance Methods
print()
click to toggle source
Method to print in format TEXT the temperature that the hash opt to include.
# File lib/text.rb, line 11 def print puts "Celsius: " + temperature.to_celsius.to_s if opt[:celsius] puts "Fahrenheit: " + temperature.to_fahrenheit.to_s if opt[:fahrenheit] puts "Kelvin: " + temperature.to_kelvin.to_s if opt[:kelvin] end