Class: Rum::Commands::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/rum/barrel.rb

Instance Method Summary collapse

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

#runObject



93
94
95
# File 'lib/rum/barrel.rb', line 93

def run
  @proc.call
end

#to_sObject



89
90
91
# File 'lib/rum/barrel.rb', line 89

def to_s
  @name
end

#visitObject



97
98
99
# File 'lib/rum/barrel.rb', line 97

def visit
  @location.visit if @location
end