Class: Cinatra::Command
- Inherits:
-
Object
- Object
- Cinatra::Command
- Defined in:
- lib/cinatra/command.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(name, desc = '', &block) ⇒ Command
constructor
A new instance of Command.
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
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
3 4 5 |
# File 'lib/cinatra/command.rb', line 3 def desc @desc end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/cinatra/command.rb', line 3 def name @name end |
#proc ⇒ Object (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 |