Class: Opennorth::Represent::Real

Inherits:
Object
  • Object
show all
Defined in:
lib/opennorth/represent.rb,
lib/opennorth/represent/requests/get_postal_code.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Real

Returns a new instance of Real.



18
19
20
# File 'lib/opennorth/represent.rb', line 18

def initialize(options={})
  @connection = Fog::Connection.new(BASE_URL,false,connection_options)
end

Instance Method Details

#get_postal_code(postal_code) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/opennorth/represent/requests/get_postal_code.rb', line 6

def get_postal_code(postal_code)
  response = request(path: postal_code_path(postal_code),
         method: :get)

  response.body = JSON::parse(response.body)
  response
end

#request(options = {}) ⇒ Object



22
23
24
# File 'lib/opennorth/represent.rb', line 22

def request(options={})
  connection.request(options)
end