Class: UrlReader
- Inherits:
-
Object
- Object
- UrlReader
- Defined in:
- lib/reader/url_reader.rb
Instance Attribute Summary collapse
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
Instance Method Summary collapse
-
#initialize(url) ⇒ UrlReader
constructor
A new instance of UrlReader.
Constructor Details
#initialize(url) ⇒ UrlReader
Returns a new instance of UrlReader.
8 9 10 |
# File 'lib/reader/url_reader.rb', line 8 def initialize(url) @temperature = Net::HTTP.get(URI.parse(url)).to_f end |
Instance Attribute Details
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
6 7 8 |
# File 'lib/reader/url_reader.rb', line 6 def temperature @temperature end |