Class: HAL9000::Action
- Inherits:
-
Object
- Object
- HAL9000::Action
- Defined in:
- lib/hal9000/action.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#thought ⇒ Object
Returns the value of attribute thought.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(thought, action) ⇒ Action
constructor
A new instance of Action.
- #to_s ⇒ Object
Constructor Details
#initialize(thought, action) ⇒ Action
Returns a new instance of Action.
10 11 12 13 |
# File 'lib/hal9000/action.rb', line 10 def initialize(thought, action) @thought = thought @action = action end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
8 9 10 |
# File 'lib/hal9000/action.rb', line 8 def action @action end |
#thought ⇒ Object
Returns the value of attribute thought.
6 7 8 |
# File 'lib/hal9000/action.rb', line 6 def thought @thought end |
Instance Method Details
#<=>(other) ⇒ Object
15 16 17 |
# File 'lib/hal9000/action.rb', line 15 def <=>(other) @thought <=> other.thought end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/hal9000/action.rb', line 19 def to_s "#{thought} => #{action}" end |