Class: MLB::CodeDescriptionType Abstract Private
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::CodeDescriptionType
- Defined in:
- lib/mlb/code_description_type.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This class is abstract.
Subclass and define specific domain semantics
Base class for simple code/description value objects from the MLB Stats API. These represent enumerated types that consist of a code identifier and human-readable description (e.g., pitch types, wind directions, sky conditions).
Direct Known Subclasses
Handedness, HitTrajectory, PitchType, ReviewReason, Sky, WindDirection
Instance Attribute Summary collapse
-
#code ⇒ String
Returns the type code identifier.
-
#description ⇒ String
Returns the human-readable description.
Instance Method Summary collapse
-
#to_s ⇒ String
Returns a string representation of the object.
Instance Attribute Details
#code ⇒ String
Returns the type code identifier
20 |
# File 'lib/mlb/code_description_type.rb', line 20 attribute :code, Shale::Type::String |
#description ⇒ String
Returns the human-readable description
28 |
# File 'lib/mlb/code_description_type.rb', line 28 attribute :description, Shale::Type::String |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the object
41 42 43 |
# File 'lib/mlb/code_description_type.rb', line 41 def to_s "#{code} (#{description})" end |