Class: RspecApiDocumentation::DSL::Endpoint::SetParam

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_api_documentation/dsl/endpoint/set_param.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent, hash, param) ⇒ SetParam

Returns a new instance of SetParam.



5
6
7
8
9
# File 'lib/rspec_api_documentation/dsl/endpoint/set_param.rb', line 5

def initialize(parent, hash, param)
  @parent = parent
  @hash = hash
  @param = param
end

Instance Method Details

#callObject



11
12
13
14
15
16
# File 'lib/rspec_api_documentation/dsl/endpoint/set_param.rb', line 11

def call
  return hash if path_params.include?(path_name)
  return hash unless method_name

  hash.deep_merge build_param_hash(key_scope || [key])
end

#valueObject



18
19
20
# File 'lib/rspec_api_documentation/dsl/endpoint/set_param.rb', line 18

def value
  example_group.send(method_name) if method_name
end