Class: ClientApiBuilder::NestedRouter

Inherits:
Object
  • Object
show all
Includes:
Router
Defined in:
lib/client_api_builder/nested_router.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Router

#build_body, #build_connection_options, #build_headers, #build_query, #build_uri, #escape_path, #expected_response_code!, #get_retry_request_max_retries, #get_retry_request_sleep_time, included, #instrument_request, #log_request_exception, #parse_response, #request_log_message, #request_wrapper, #retry_request, #retry_request?

Constructor Details

#initialize(root_router, nested_router_options) ⇒ NestedRouter

Returns a new instance of NestedRouter.



14
15
16
17
# File 'lib/client_api_builder/nested_router.rb', line 14

def initialize(root_router, nested_router_options)
  @root_router = root_router
  @nested_router_options = nested_router_options
end

Instance Attribute Details

#nested_router_optionsObject (readonly)

Returns the value of attribute nested_router_options.



11
12
13
# File 'lib/client_api_builder/nested_router.rb', line 11

def nested_router_options
  @nested_router_options
end

#root_routerObject (readonly)

Returns the value of attribute root_router.



11
12
13
# File 'lib/client_api_builder/nested_router.rb', line 11

def root_router
  @root_router
end

Class Method Details

.get_instance_method(var) ⇒ Object



19
20
21
# File 'lib/client_api_builder/nested_router.rb', line 19

def self.get_instance_method(var)
  "\#{root_router.#{var}\}"
end

Instance Method Details

#base_urlObject



23
24
25
# File 'lib/client_api_builder/nested_router.rb', line 23

def base_url
  self.class.base_url || root_router.base_url
end

#handle_response(response, options, &block) ⇒ Object



27
28
29
# File 'lib/client_api_builder/nested_router.rb', line 27

def handle_response(response, options, &block)
  root_router.handle_response(response, options, &block)
end