Class: JamesBond::Core::MissionPool
- Inherits:
-
Object
- Object
- JamesBond::Core::MissionPool
- Defined in:
- lib/james_bond/core/mission_pool.rb
Instance Attribute Summary collapse
-
#mission_by_main_command ⇒ Object
Returns the value of attribute mission_by_main_command.
-
#mission_list ⇒ Object
Returns the value of attribute mission_list.
Instance Method Summary collapse
- #decide_mission(command) ⇒ Object
-
#initialize(params = {}) ⇒ MissionPool
constructor
A new instance of MissionPool.
Constructor Details
#initialize(params = {}) ⇒ MissionPool
Returns a new instance of MissionPool.
6 7 8 9 |
# File 'lib/james_bond/core/mission_pool.rb', line 6 def initialize(params={}) @mission_list = params[:mission_list] build_mission_by_main_command end |
Instance Attribute Details
#mission_by_main_command ⇒ Object
Returns the value of attribute mission_by_main_command.
4 5 6 |
# File 'lib/james_bond/core/mission_pool.rb', line 4 def mission_by_main_command @mission_by_main_command end |
#mission_list ⇒ Object
Returns the value of attribute mission_list.
4 5 6 |
# File 'lib/james_bond/core/mission_pool.rb', line 4 def mission_list @mission_list end |
Instance Method Details
#decide_mission(command) ⇒ Object
11 12 13 |
# File 'lib/james_bond/core/mission_pool.rb', line 11 def decide_mission(command) @mission_by_main_command[command.main_command] end |