Class: Sinatra::Rabbit::Feature::Operation
- Inherits:
-
Object
- Object
- Sinatra::Rabbit::Feature::Operation
- Defined in:
- lib/sinatra/rabbit/features.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ Operation
constructor
A new instance of Operation.
- #param(*args) ⇒ Object
- #params_array ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Operation
Returns a new instance of Operation.
52 53 54 55 |
# File 'lib/sinatra/rabbit/features.rb', line 52 def initialize(name, &block) @name = name @params = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
49 50 51 |
# File 'lib/sinatra/rabbit/features.rb', line 49 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
50 51 52 |
# File 'lib/sinatra/rabbit/features.rb', line 50 def params @params end |
Instance Method Details
#param(*args) ⇒ Object
63 64 65 |
# File 'lib/sinatra/rabbit/features.rb', line 63 def param(*args) @p_arr << Rabbit::Param.new(*args) end |
#params_array ⇒ Object
57 58 59 60 61 |
# File 'lib/sinatra/rabbit/features.rb', line 57 def params_array @p_arr = [] instance_eval(&self.params) @p_arr end |