Class: Sinatra::Rabbit::Feature::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/rabbit/features.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



49
50
51
# File 'lib/sinatra/rabbit/features.rb', line 49

def name
  @name
end

#paramsObject (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_arrayObject



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