Class: NearestTimeZone::TimeZone

Inherits:
Object
  • Object
show all
Defined in:
lib/nearest_time_zone/time_zone.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/nearest_time_zone/time_zone.rb', line 4

def id
  @id
end

#nameObject

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

.allObject



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