Class: Rum::Commands::Command
- Inherits:
-
Object
- Object
- Rum::Commands::Command
- Defined in:
- lib/rum/barrel.rb
Instance Method Summary collapse
-
#initialize(name, proc, location) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
- #to_s ⇒ Object
- #visit ⇒ Object
Constructor Details
#initialize(name, proc, location) ⇒ Command
Returns a new instance of Command.
83 84 85 86 87 |
# File 'lib/rum/barrel.rb', line 83 def initialize(name, proc, location) @name = name @proc = proc @location = location end |
Instance Method Details
#run ⇒ Object
93 94 95 |
# File 'lib/rum/barrel.rb', line 93 def run @proc.call end |
#to_s ⇒ Object
89 90 91 |
# File 'lib/rum/barrel.rb', line 89 def to_s @name end |
#visit ⇒ Object
97 98 99 |
# File 'lib/rum/barrel.rb', line 97 def visit @location.visit if @location end |