Class: SgPostcode::ResponseBuilder::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sg_postcode/response/config.rb

Class Method Summary collapse

Class Method Details

.add_key_path(key_name, *path) ⇒ Object

add a custom key_path



11
12
13
# File 'lib/sg_postcode/response/config.rb', line 11

def add_key_path(key_name, *path)
  #TODO
end

.default_fieldsObject

default fields (key_paths)



24
25
26
27
28
29
30
# File 'lib/sg_postcode/response/config.rb', line 24

def default_fields
  {
    format_address: ['formatted_address'],
    lat: ['geometry', 'location', 'lat'],
    long: ['geometry', 'location', 'lng'],
  }
end

.fieldsObject

Get all response fields (key_paths)



6
7
8
# File 'lib/sg_postcode/response/config.rb', line 6

def fields
  @@fields ||= default_fields
end

.remove_key_path(key_name) ⇒ Object

remove a key_path

Returns:

  • nothing if keypath doesn’t exist



19
20
21
# File 'lib/sg_postcode/response/config.rb', line 19

def remove_key_path(key_name)
  #TODO
end