Module: Operate::Command::ClassMethods

Defined in:
lib/operate/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#command_presenterObject (readonly)

Returns the value of attribute command_presenter.



21
22
23
# File 'lib/operate/command.rb', line 21

def command_presenter
  @command_presenter
end

Instance Method Details

#call(*args, &block) ⇒ Object

Call will initialize the class with *args and invoke instance method ‘call` with no arguments



24
25
26
27
28
# File 'lib/operate/command.rb', line 24

def call(*args, &block)
  command = new(*args)
  command.evaluate(&block) if block_given?
  command.call
end