Class: RequestParamsValidation::Definitions::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/request_params_validation/definitions/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Action

Returns a new instance of Action.



8
9
10
# File 'lib/request_params_validation/definitions/action.rb', line 8

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/request_params_validation/definitions/action.rb', line 6

def name
  @name
end

Instance Method Details

#request(&block) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/request_params_validation/definitions/action.rb', line 12

def request(&block)
  if block_given?
    @request = Request.new

    @request.instance_eval(&block)
  else
    @request
  end
end