Class: Cinatra::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/cinatra/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, desc = '', &block) ⇒ Command

Returns a new instance of Command.



5
6
7
8
9
# File 'lib/cinatra/command.rb', line 5

def initialize(name, desc = '', &block)
  @name = name
  @desc = desc
  @proc = block
end

Instance Attribute Details

#descObject (readonly)

Returns the value of attribute desc.



3
4
5
# File 'lib/cinatra/command.rb', line 3

def desc
  @desc
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/cinatra/command.rb', line 3

def name
  @name
end

#procObject (readonly)

Returns the value of attribute proc.



3
4
5
# File 'lib/cinatra/command.rb', line 3

def proc
  @proc
end

Instance Method Details

#call(*args) ⇒ Object



11
12
13
# File 'lib/cinatra/command.rb', line 11

def call(*args)
  proc.call(*args)
end