Class: SportsManager::TeamBuilder
- Defined in:
- lib/sports_manager/team_builder.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#participants ⇒ Object
readonly
Returns the value of attribute participants.
-
#subscriptions ⇒ Object
readonly
Returns the value of attribute subscriptions.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(category:, subscriptions:) ⇒ TeamBuilder
constructor
A new instance of TeamBuilder.
Constructor Details
#initialize(category:, subscriptions:) ⇒ TeamBuilder
Returns a new instance of TeamBuilder.
7 8 9 10 11 |
# File 'lib/sports_manager/team_builder.rb', line 7 def initialize(category:, subscriptions:) @category = category @subscriptions = subscriptions @participants = subscriptions.flatten end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
5 6 7 |
# File 'lib/sports_manager/team_builder.rb', line 5 def category @category end |
#participants ⇒ Object (readonly)
Returns the value of attribute participants.
5 6 7 |
# File 'lib/sports_manager/team_builder.rb', line 5 def participants @participants end |
#subscriptions ⇒ Object (readonly)
Returns the value of attribute subscriptions.
5 6 7 |
# File 'lib/sports_manager/team_builder.rb', line 5 def subscriptions @subscriptions end |
Instance Method Details
#build ⇒ Object
13 14 15 |
# File 'lib/sports_manager/team_builder.rb', line 13 def build subscriptions.map(&method(:build_team)) end |