Class: OpenapiRuby::Adapters::RSpec::PathProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_ruby/adapters/rspec.rb

Instance Method Summary collapse

Constructor Details

#initialize(example_group, context) ⇒ PathProxy

Returns a new instance of PathProxy.



29
30
31
32
# File 'lib/openapi_ruby/adapters/rspec.rb', line 29

def initialize(example_group, context)
  @example_group = example_group
  @context = context
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object (private)

Forward missing methods to the example group for non-DSL calls



56
57
58
59
60
61
62
# File 'lib/openapi_ruby/adapters/rspec.rb', line 56

def method_missing(name, ...)
  if @example_group.respond_to?(name)
    @example_group.send(name, ...)
  else
    super
  end
end

Instance Method Details

#parameter(attributes = {}) ⇒ Object



34
35
36
# File 'lib/openapi_ruby/adapters/rspec.rb', line 34

def parameter(attributes = {})
  @context.parameter(attributes)
end