Class: RubyWarrior::Turn
- Inherits:
-
Object
- Object
- RubyWarrior::Turn
- Defined in:
- lib/ruby_warrior/turn.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
Instance Method Summary collapse
-
#initialize(abilities) ⇒ Turn
constructor
A new instance of Turn.
Constructor Details
#initialize(abilities) ⇒ Turn
Returns a new instance of Turn.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ruby_warrior/turn.rb', line 5 def initialize(abilities) @action = nil @senses = {} abilities.each do |name, sense| if name.to_s =~ /\!$/ add_action(name) else add_sense(name, sense) end end end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/ruby_warrior/turn.rb', line 3 def action @action end |