class JsonPrinter
Public Class Methods
new(temperature)
click to toggle source
# File lib/printer/json_printer.rb, line 3 def initialize(temperature) @temperature = temperature end
Public Instance Methods
print()
click to toggle source
# File lib/printer/json_printer.rb, line 7 def print "{"\ "celsius: #{@temperature.to_celsius}, "\ "fahrenheit: #{@temperature.to_fahrenheit}, "\ "kelvin: #{@temperature.to_kelvin}"\ "}" end