Class: FileReader
- Inherits:
-
Object
- Object
- FileReader
- Defined in:
- lib/read_file.rb
Instance Attribute Summary collapse
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
Instance Method Summary collapse
-
#initialize ⇒ FileReader
constructor
A new instance of FileReader.
- #read(file) ⇒ Object
Constructor Details
#initialize ⇒ FileReader
Returns a new instance of FileReader.
5 6 7 |
# File 'lib/read_file.rb', line 5 def initialize $temperature end |
Instance Attribute Details
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
3 4 5 |
# File 'lib/read_file.rb', line 3 def temperature @temperature end |
Instance Method Details
#read(file) ⇒ Object
9 10 11 |
# File 'lib/read_file.rb', line 9 def read file $temperature = File.open(file).read end |