Class: Osm::Grouping
- Inherits:
-
Object
- Object
- Osm::Grouping
- Defined in:
- lib/osm/grouping.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#id ⇒ Boolean
readonly
Wether the grouping is active.
-
#name ⇒ String
readonly
The name of the grouping.
-
#points ⇒ Fixnum
readonly
The points awarded to the grouping.
Instance Method Summary collapse
-
#initialize(data) ⇒ Grouping
constructor
Initialize a new Grouping using the hash returned by the API call.
Constructor Details
#initialize(data) ⇒ Grouping
Initialize a new Grouping using the hash returned by the API call
17 18 19 20 21 22 |
# File 'lib/osm/grouping.rb', line 17 def initialize(data) @id = Osm::to_i_or_nil(data['patrolid']) @name = data['name'] @active = (data['active'] == 1) @points = Osm::to_i_or_nil(data['points']) end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
5 6 7 |
# File 'lib/osm/grouping.rb', line 5 def active @active end |
#id ⇒ Boolean (readonly)
Returns wether the grouping is active.
6 7 8 |
# File 'lib/osm/grouping.rb', line 6 def id @id end |
#name ⇒ String (readonly)
Returns the name of the grouping.
6 7 8 |
# File 'lib/osm/grouping.rb', line 6 def name @name end |
#points ⇒ Fixnum (readonly)
Returns the points awarded to the grouping.
6 7 8 |
# File 'lib/osm/grouping.rb', line 6 def points @points end |