Class: TemperatureConverter

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

Instance Method Summary collapse

Instance Method Details

#commandline_temperature(value) ⇒ Object



12
13
14
15
# File 'lib/temperature_converter.rb', line 12

def commandline_temperature value
  cmdreader = CommandlineReader.new value
  cmdreader.read
end

#file_temperature(file) ⇒ Object



17
18
19
20
# File 'lib/temperature_converter.rb', line 17

def file_temperature file
  filereader = FileReader.new
  filereader.read(file)
end

#mqtt_reader(ttn_host, port, username, password, sensor_id) ⇒ Object



27
28
29
30
# File 'lib/temperature_converter.rb', line 27

def mqtt_reader (ttn_host, port, username, password, sensor_id)
  mqttreader = MQTTReader.new
  mqttreader.read(ttn_host, port, username, password, sensor_id)
end

#to_htmlObject



42
43
44
45
# File 'lib/temperature_converter.rb', line 42

def to_html
  htmlprint = PrintHtml.new
  htmlprint.print
end

#to_jsonObject



37
38
39
40
# File 'lib/temperature_converter.rb', line 37

def to_json
  jsonprint = PrintJson.new
  jsonprint.print
end

#to_textObject



32
33
34
35
# File 'lib/temperature_converter.rb', line 32

def to_text
  textprint = PrintText.new
  textprint.print
end

#url_temperature(url) ⇒ Object



22
23
24
25
# File 'lib/temperature_converter.rb', line 22

def url_temperature url
  urlreader = URLReader.new
  urlreader.read(url)
end