Class: NikeV2::ExperienceType
- Inherits:
-
Object
- Object
- NikeV2::ExperienceType
- Defined in:
- lib/nike_v2/experience_type.rb
Constant Summary collapse
- TO_S_MAP =
{ 'fuelband' => 'Fuel Band', 'npluskinecttrg' => 'Nike+ Kinect', 'running' => 'Running' }
- TO_KEY_MAP =
TO_S_MAP.invert
Class Method Summary collapse
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(code) ⇒ ExperienceType
constructor
A new instance of ExperienceType.
- #to_s ⇒ Object
Constructor Details
#initialize(code) ⇒ ExperienceType
Returns a new instance of ExperienceType.
11 12 13 |
# File 'lib/nike_v2/experience_type.rb', line 11 def initialize(code) @code = code end |
Class Method Details
.code_from_string(string) ⇒ Object
23 24 25 |
# File 'lib/nike_v2/experience_type.rb', line 23 def self.code_from_string(string) TO_KEY_MAP[string] end |
Instance Method Details
#code ⇒ Object
15 16 17 |
# File 'lib/nike_v2/experience_type.rb', line 15 def code @code end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/nike_v2/experience_type.rb', line 19 def to_s TO_S_MAP[code.downcase] end |