Class: CyprusPostalCodes::Client
- Inherits:
-
Object
- Object
- CyprusPostalCodes::Client
- Includes:
- Addresses, Areas, Districts, GovernmentServices, OccupiedAreas, Paginator, Parcel24Locations, PostOfficeBoxes, Search
- Defined in:
- lib/cyprus_postal_codes/client.rb,
lib/cyprus_postal_codes/client/areas.rb,
lib/cyprus_postal_codes/client/search.rb,
lib/cyprus_postal_codes/client/addresses.rb,
lib/cyprus_postal_codes/client/districts.rb,
lib/cyprus_postal_codes/client/paginator.rb,
lib/cyprus_postal_codes/client/occupied_areas.rb,
lib/cyprus_postal_codes/client/post_office_boxes.rb,
lib/cyprus_postal_codes/client/parcel24_locations.rb,
lib/cyprus_postal_codes/client/government_services.rb
Defined Under Namespace
Modules: Addresses, Areas, Districts, GovernmentServices, OccupiedAreas, Paginator, Parcel24Locations, PostOfficeBoxes, Search
Instance Method Summary collapse
- #get(resource, options = {}) ⇒ Object
-
#initialize(api_key:, lng: "el") ⇒ Client
constructor
A new instance of Client.
- #last_response ⇒ Object
Methods included from Search
Methods included from PostOfficeBoxes
Methods included from Parcel24Locations
Methods included from Paginator
#first_page, #last_page, #next_page, #previous_page, #total_count, #total_pages
Methods included from OccupiedAreas
Methods included from GovernmentServices
Methods included from Districts
Methods included from Areas
Methods included from Addresses
Constructor Details
#initialize(api_key:, lng: "el") ⇒ Client
Returns a new instance of Client.
21 22 23 24 |
# File 'lib/cyprus_postal_codes/client.rb', line 21 def initialize(api_key:, lng: "el") @api_key = api_key @lng = lng end |
Instance Method Details
#get(resource, options = {}) ⇒ Object
26 27 28 29 |
# File 'lib/cyprus_postal_codes/client.rb', line 26 def get(resource, = {}) @last_response = connection.get(resource, .merge(default_params)) @last_response.body["data"] end |
#last_response ⇒ Object
31 32 33 |
# File 'lib/cyprus_postal_codes/client.rb', line 31 def last_response @last_response if defined?(@last_response) end |