Class: MLB::Position
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::Position
- Defined in:
- lib/mlb/position.rb
Overview
Represents a baseball position
Constant Summary collapse
- TYPE_PITCHER =
"Pitcher".freeze
- TYPE_CATCHER =
"Catcher".freeze
- TYPE_INFIELDER =
"Infielder".freeze
- TYPE_OUTFIELDER =
"Outfielder".freeze
Instance Attribute Summary collapse
-
#abbreviation ⇒ String
Returns the position abbreviation.
-
#code ⇒ String
Returns the position code.
-
#name ⇒ String
Returns the position name.
-
#type ⇒ String
Returns the position type.
Instance Method Summary collapse
-
#catcher? ⇒ Boolean
Returns whether this is a catcher position.
-
#infielder? ⇒ Boolean
Returns whether this is an infielder position.
-
#outfielder? ⇒ Boolean
Returns whether this is an outfielder position.
-
#pitcher? ⇒ Boolean
Returns whether this is a pitcher position.
Instance Attribute Details
#abbreviation ⇒ String
Returns the position abbreviation
44 |
# File 'lib/mlb/position.rb', line 44 attribute :abbreviation, Shale::Type::String |
#code ⇒ String
Returns the position code
20 |
# File 'lib/mlb/position.rb', line 20 attribute :code, Shale::Type::String |
#name ⇒ String
Returns the position name
28 |
# File 'lib/mlb/position.rb', line 28 attribute :name, Shale::Type::String |
#type ⇒ String
Returns the position type
36 |
# File 'lib/mlb/position.rb', line 36 attribute :type, Shale::Type::String |
Instance Method Details
#catcher? ⇒ Boolean
Returns whether this is a catcher position
60 |
# File 'lib/mlb/position.rb', line 60 def catcher? = type.eql?(TYPE_CATCHER) |
#infielder? ⇒ Boolean
Returns whether this is an infielder position
68 |
# File 'lib/mlb/position.rb', line 68 def infielder? = type.eql?(TYPE_INFIELDER) |
#outfielder? ⇒ Boolean
Returns whether this is an outfielder position
76 |
# File 'lib/mlb/position.rb', line 76 def outfielder? = type.eql?(TYPE_OUTFIELDER) |
#pitcher? ⇒ Boolean
Returns whether this is a pitcher position
52 |
# File 'lib/mlb/position.rb', line 52 def pitcher? = type.eql?(TYPE_PITCHER) |