Class: UrlReader

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#temperatureObject (readonly)

Returns the value of attribute temperature.



6
7
8
# File 'lib/reader/url_reader.rb', line 6

def temperature
  @temperature
end