Class: Baptize::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/baptize/application.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, description = nil, &block) ⇒ Command

Returns a new instance of Command.



13
14
15
# File 'lib/baptize/application.rb', line 13

def initialize(name, description=nil, &block)
  @name, @description, @block = name.to_sym, description, block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



11
12
13
# File 'lib/baptize/application.rb', line 11

def block
  @block
end

#descriptionObject (readonly)

Returns the value of attribute description.



11
12
13
# File 'lib/baptize/application.rb', line 11

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/baptize/application.rb', line 11

def name
  @name
end

Instance Method Details

#invoke(*args) ⇒ Object



17
18
19
# File 'lib/baptize/application.rb', line 17

def invoke(*args)
  block.call(*args)
end