Class: SimpleEndpoint::Endpoint::EndpointOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_endpoint/endpoint/endpoint_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ EndpointOptions

Returns a new instance of EndpointOptions.



8
9
10
# File 'lib/simple_endpoint/endpoint/endpoint_options.rb', line 8

def initialize(**options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/simple_endpoint/endpoint/endpoint_options.rb', line 6

def options
  @options
end

Instance Method Details

#before_responseObject



24
25
26
# File 'lib/simple_endpoint/endpoint/endpoint_options.rb', line 24

def before_response
  @before_response ||= (options[:before_response] || invoker.__before_response) || {}
end

#casesObject



32
33
34
# File 'lib/simple_endpoint/endpoint/endpoint_options.rb', line 32

def cases
  @cases ||= options[:default_cases].merge(options[:different_cases] || invoker.__different_cases || {})
end

#handlerObject



28
29
30
# File 'lib/simple_endpoint/endpoint/endpoint_options.rb', line 28

def handler
  @handler ||= options[:default_handler].merge(options[:different_handler] || invoker.__different_handler || {})
end

#invokerObject



12
13
14
# File 'lib/simple_endpoint/endpoint/endpoint_options.rb', line 12

def invoker
  options[:invoker]
end

#renderer_optionsObject



20
21
22
# File 'lib/simple_endpoint/endpoint/endpoint_options.rb', line 20

def renderer_options
  @renderer_options ||= options[:renderer_options] || {}
end

#resultObject



16
17
18
# File 'lib/simple_endpoint/endpoint/endpoint_options.rb', line 16

def result
  options[:result]
end