Class: NearestTimeZone::TimeZone
- Inherits:
-
Object
- Object
- NearestTimeZone::TimeZone
- Defined in:
- lib/nearest_time_zone/time_zone.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, name) ⇒ TimeZone
constructor
A new instance of TimeZone.
Constructor Details
#initialize(id, name) ⇒ TimeZone
Returns a new instance of TimeZone.
6 7 8 |
# File 'lib/nearest_time_zone/time_zone.rb', line 6 def initialize(id, name) self.id, self.name = id, name end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/nearest_time_zone/time_zone.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/nearest_time_zone/time_zone.rb', line 4 def name @name end |
Class Method Details
.all ⇒ Object
14 15 16 |
# File 'lib/nearest_time_zone/time_zone.rb', line 14 def self.all @all ||= load_all end |
.find(id) ⇒ Object
18 19 20 |
# File 'lib/nearest_time_zone/time_zone.rb', line 18 def self.find(id) all[id.to_i] end |