Class: PrintJson
- Inherits:
-
Object
- Object
- PrintJson
- Defined in:
- lib/print_json.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.
6 7 8 |
# File 'lib/print_json.rb', line 6 def temperature @temperature end |
Instance Method Details
#print ⇒ Object
8 9 10 11 12 |
# File 'lib/print_json.rb', line 8 def print jsontemerature = Temperature.new puts "{celsius: #{jsontemerature.celsius.to_s}, fahrenheit: #{jsontemerature.to_fahrenheit.to_s}, kelvin: #{jsontemerature.to_kelvin.to_s}}" end |