Module: WCC::Data::Mapper::RESTConfiguration

Included in:
WCC::Data::Model
Defined in:
lib/wcc/data/mapper/rest_configuration.rb

Instance Method Summary collapse

Instance Method Details

#endpointObject



16
17
18
19
20
# File 'lib/wcc/data/mapper/rest_configuration.rb', line 16

def endpoint
  @endpoint = WCC::Data::RESTEndpoint.new(
    service: service_from_app_name(endpoint_config[:app]).merge(uri: endpoint_config[:uri])
  )
end

#endpoint_configObject



12
13
14
# File 'lib/wcc/data/mapper/rest_configuration.rb', line 12

def endpoint_config
  @endpoint_config ||= {}
end

#inherited(subclass) ⇒ Object



22
23
24
25
# File 'lib/wcc/data/mapper/rest_configuration.rb', line 22

def inherited(subclass)
  super
  subclass.instance_variable_set(:@endpoint_config, endpoint_config.dup)
end

#set_endpoint(app_name, uri) ⇒ Object



5
6
7
8
9
10
# File 'lib/wcc/data/mapper/rest_configuration.rb', line 5

def set_endpoint(app_name, uri)
  @endpoint_config = {
    app: app_name,
    uri: uri,
  }
end