Class: Action
- Inherits:
-
Object
- Object
- Action
- Defined in:
- lib/Action/action.rb
Overview
Defines a base action.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action_completed ⇒ Object
writeonly
Sets the attribute action_completed.
-
#action_time ⇒ Object
Returns the value of attribute action_time.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Instance Method Summary collapse
- #action_completed? ⇒ Boolean
-
#initialize(value, weight) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(value, weight) ⇒ Action
Returns a new instance of Action.
10 11 12 13 14 15 |
# File 'lib/Action/action.rb', line 10 def initialize(value, weight) @value = value @weight = weight @action_time = Time.now @action_completed = false end |
Instance Attribute Details
#action_completed=(value) ⇒ Object (writeonly)
Sets the attribute action_completed
21 22 23 |
# File 'lib/Action/action.rb', line 21 def action_completed=(value) @action_completed = value end |
#action_time ⇒ Object
Returns the value of attribute action_time.
8 9 10 |
# File 'lib/Action/action.rb', line 8 def action_time @action_time end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/Action/action.rb', line 7 def value @value end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
7 8 9 |
# File 'lib/Action/action.rb', line 7 def weight @weight end |
Instance Method Details
#action_completed? ⇒ Boolean
17 18 19 |
# File 'lib/Action/action.rb', line 17 def action_completed? @action_completed end |