Class: PrintText
- Inherits:
-
Object
- Object
- PrintText
- Defined in:
- lib/print_text.rb
Instance Attribute Summary collapse
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
Instance Method Summary collapse
Instance Attribute Details
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
5 6 7 |
# File 'lib/print_text.rb', line 5 def temperature @temperature end |
Instance Method Details
#print ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/print_text.rb', line 7 def print texttemerature = Temperature.new puts "Temperature: " puts texttemerature.celsius.to_s + " °C" puts texttemerature.to_fahrenheit.to_s + " °F" puts texttemerature.to_kelvin.to_s + " K" end |