Class: TemperatureReadFile

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTemperatureReadFile

Returns a new instance of TemperatureReadFile.



11
12
13
# File 'lib/temperature_read_file.rb', line 11

def initialize
	@temp = 0
end

Instance Attribute Details

#tempObject (readonly)

Returns the value of attribute temp.



9
10
11
# File 'lib/temperature_read_file.rb', line 9

def temp
  @temp
end

Class Method Details

.file_temperature(path) ⇒ Object



19
20
21
22
23
# File 'lib/temperature_read_file.rb', line 19

def self.file_temperature path
	@path = path
	f = File.open(path, "r")
	temp = f.sysread(6).to_f
end