Class: TemperatureOutputToText

Inherits:
Object
  • Object
show all
Defined in:
lib/temperature_output_to_text.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#tempObject (readonly)

Returns the value of attribute temp.



7
8
9
# File 'lib/temperature_output_to_text.rb', line 7

def temp
  @temp
end

Class Method Details

.to_text(celcius, fahrenheit, kelvin) ⇒ Object


outputting



12
13
14
15
16
17
# File 'lib/temperature_output_to_text.rb', line 12

def self.to_text(celcius, fahrenheit, kelvin)
	"Temperature\n" +
		"#{celcius}  °C\n" +
		"#{fahrenheit} °F\n" +
		"#{kelvin}  K\n"
end