Class: Redlink::Location

Inherits:
Redthing show all
Defined in:
lib/redlink/location.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Redthing

#initialize

Constructor Details

This class inherits a constructor from Redlink::Redthing

Instance Attribute Details

#countryObject

Returns the value of attribute country.



3
4
5
# File 'lib/redlink/location.rb', line 3

def country
  @country
end

#current_weatherObject

Returns the value of attribute current_weather.



3
4
5
# File 'lib/redlink/location.rb', line 3

def current_weather
  @current_weather
end

#location_idObject

Returns the value of attribute location_id.



3
4
5
# File 'lib/redlink/location.rb', line 3

def location_id
  @location_id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/redlink/location.rb', line 3

def name
  @name
end

#thermostatsObject

Returns the value of attribute thermostats.



3
4
5
# File 'lib/redlink/location.rb', line 3

def thermostats
  @thermostats
end

#time_zoneObject

Returns the value of attribute time_zone.



3
4
5
# File 'lib/redlink/location.rb', line 3

def time_zone
  @time_zone
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/redlink/location.rb', line 3

def type
  @type
end

#zip_codeObject

Returns the value of attribute zip_code.



3
4
5
# File 'lib/redlink/location.rb', line 3

def zip_code
  @zip_code
end

Class Method Details

.allObject



23
24
25
26
27
# File 'lib/redlink/location.rb', line 23

def self.all
  @all ||= Endpoint.locations.map do |loc|
    Location.new(loc)
  end
end

.firstObject



29
30
31
# File 'lib/redlink/location.rb', line 29

def self.first
  all[0]
end

.lastObject



33
34
35
# File 'lib/redlink/location.rb', line 33

def self.last
  all[all.length - 1]
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/redlink/location.rb', line 19

def to_s
  name
end