Class: MLB::Transaction
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::Transaction
- Defined in:
- lib/mlb/transaction.rb
Overview
Represents a player transaction (trade, signing, etc.)
Constant Summary collapse
- TYPE_TRADE =
"TR".freeze
- TYPE_FREE_AGENT =
"FA".freeze
- TYPE_ASSIGNMENT =
"ASG".freeze
- TYPE_SIGNING =
"SGN".freeze
- TYPE_RELEASE =
"REL".freeze
- TYPE_WAIVER =
"WV".freeze
Instance Attribute Summary collapse
-
#date ⇒ Date
Returns the date of the transaction.
-
#description ⇒ String
Returns the full transaction description.
-
#effective_date ⇒ Date
Returns the effective date of the transaction.
-
#from_team ⇒ Team?
Returns the team the player is leaving.
-
#id ⇒ Integer
Returns the unique identifier for the transaction.
-
#player ⇒ Player
Returns the player involved in the transaction.
-
#resolution_date ⇒ Date
Returns the resolution date of the transaction.
-
#to_team ⇒ Team
Returns the team the player is joining.
-
#type_code ⇒ String
Returns the transaction type code.
-
#type_desc ⇒ String
Returns the transaction type description.
Instance Method Summary collapse
-
#assignment? ⇒ Boolean
Returns whether this is an assignment transaction.
-
#free_agent? ⇒ Boolean
Returns whether this is a free agent transaction.
-
#release? ⇒ Boolean
Returns whether this is a release transaction.
-
#signing? ⇒ Boolean
Returns whether this is a signing transaction.
-
#trade? ⇒ Boolean
Returns whether this is a trade transaction.
-
#waiver? ⇒ Boolean
Returns whether this is a waiver transaction.
Instance Attribute Details
#date ⇒ Date
Returns the date of the transaction
56 |
# File 'lib/mlb/transaction.rb', line 56 attribute :date, Shale::Type::Date |
#description ⇒ String
Returns the full transaction description
96 |
# File 'lib/mlb/transaction.rb', line 96 attribute :description, Shale::Type::String |
#effective_date ⇒ Date
Returns the effective date of the transaction
64 |
# File 'lib/mlb/transaction.rb', line 64 attribute :effective_date, Shale::Type::Date |
#from_team ⇒ Team?
Returns the team the player is leaving
40 |
# File 'lib/mlb/transaction.rb', line 40 attribute :from_team, Team, default: nil |
#id ⇒ Integer
Returns the unique identifier for the transaction
24 |
# File 'lib/mlb/transaction.rb', line 24 attribute :id, Shale::Type::Integer |
#player ⇒ Player
Returns the player involved in the transaction
32 |
# File 'lib/mlb/transaction.rb', line 32 attribute :player, Player |
#resolution_date ⇒ Date
Returns the resolution date of the transaction
72 |
# File 'lib/mlb/transaction.rb', line 72 attribute :resolution_date, Shale::Type::Date |
#to_team ⇒ Team
Returns the team the player is joining
48 |
# File 'lib/mlb/transaction.rb', line 48 attribute :to_team, Team |
#type_code ⇒ String
Returns the transaction type code
80 |
# File 'lib/mlb/transaction.rb', line 80 attribute :type_code, Shale::Type::String |
#type_desc ⇒ String
Returns the transaction type description
88 |
# File 'lib/mlb/transaction.rb', line 88 attribute :type_desc, Shale::Type::String |
Instance Method Details
#assignment? ⇒ Boolean
Returns whether this is an assignment transaction
120 |
# File 'lib/mlb/transaction.rb', line 120 def assignment? = type_code.eql?(TYPE_ASSIGNMENT) |
#free_agent? ⇒ Boolean
Returns whether this is a free agent transaction
112 |
# File 'lib/mlb/transaction.rb', line 112 def free_agent? = type_code.eql?(TYPE_FREE_AGENT) |
#release? ⇒ Boolean
Returns whether this is a release transaction
136 |
# File 'lib/mlb/transaction.rb', line 136 def release? = type_code.eql?(TYPE_RELEASE) |
#signing? ⇒ Boolean
Returns whether this is a signing transaction
128 |
# File 'lib/mlb/transaction.rb', line 128 def signing? = type_code.eql?(TYPE_SIGNING) |
#trade? ⇒ Boolean
Returns whether this is a trade transaction
104 |
# File 'lib/mlb/transaction.rb', line 104 def trade? = type_code.eql?(TYPE_TRADE) |
#waiver? ⇒ Boolean
Returns whether this is a waiver transaction
144 |
# File 'lib/mlb/transaction.rb', line 144 def waiver? = type_code.eql?(TYPE_WAIVER) |