Class: Ability::ChoiceInstance
- Includes:
- FromHash
- Defined in:
- lib/ascension/ability.rb
Instance Attribute Summary collapse
-
#choice ⇒ Object
Returns the value of attribute choice.
-
#side ⇒ Object
Returns the value of attribute side.
Instance Method Summary collapse
- #addl_json_attributes ⇒ Object
- #delete! ⇒ Object
- #execute!(chosen_card) ⇒ Object
- #name ⇒ Object
- #save! ⇒ Object
Instance Attribute Details
#choice ⇒ Object
Returns the value of attribute choice.
11 12 13 |
# File 'lib/ascension/ability.rb', line 11 def choice @choice end |
#side ⇒ Object
Returns the value of attribute side.
11 12 13 |
# File 'lib/ascension/ability.rb', line 11 def side @side end |
Instance Method Details
#addl_json_attributes ⇒ Object
14 15 16 |
# File 'lib/ascension/ability.rb', line 14 def addl_json_attributes %w(choosable_cards name) end |
#delete! ⇒ Object
37 38 39 |
# File 'lib/ascension/ability.rb', line 37 def delete! side.choices -= [self] end |
#execute!(chosen_card) ⇒ Object
32 33 34 35 |
# File 'lib/ascension/ability.rb', line 32 def execute!(chosen_card) choice.action(chosen_card,side) delete! end |
#name ⇒ Object
17 18 19 |
# File 'lib/ascension/ability.rb', line 17 def name choice.class.to_s end |
#save! ⇒ Object
28 29 30 |
# File 'lib/ascension/ability.rb', line 28 def save! side.choices << self end |