class Html
Attributes
opt[R]
temperature[R]
Public Class Methods
new(temperature,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/html.rb, line 6 def initialize(temperature,opt) @temperature=temperature @opt=opt end
Public Instance Methods
print()
click to toggle source
Method to print in format HTML the temperature that the hash opt to include.
# File lib/html.rb, line 11 def print puts '<div>' puts ' <p> Celsius: ' + temperature.to_celsius.to_s + '</p>' if opt[:celsius] puts ' <p> Fahrenheit: ' + temperature.to_fahrenheit.to_s + '</p>' if opt[:fahrenheit] puts ' <p> Kelvin: ' + temperature.to_kelvin.to_s + '</p>' if opt[:kelvin] puts '</div>' end