Class: RspecApiDocumentation::DSL::Endpoint::SetParam
- Inherits:
-
Object
- Object
- RspecApiDocumentation::DSL::Endpoint::SetParam
- Defined in:
- lib/rspec_api_documentation/dsl/endpoint/set_param.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(parent, hash, param) ⇒ SetParam
constructor
A new instance of SetParam.
- #value ⇒ Object
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
#call ⇒ Object
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 |
#value ⇒ Object
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 |