Skip to content

sliwecki/inpost_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InpostApi

Installation

Add this line to your application's Gemfile:

gem 'inpost_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install inpost_api

Usage

First, you must set up config (for example in config/initializers/inpost.rb) and add following code:

InpostApi.configure do |config|
  config.endpoint = 'https://api-pl.easypack24.net/v4/machines'
end

Next, you should use available methods:

1) Get Inpost Lockers
InpostApi.get_inpost_lockers => Array

InpostApi.get_inpost_lockers(type: 1) => Array
  • optional options: :type,
2) Get Inpost Locker
InpostApi.get_inpost_locker('ALL992')

InpostApi.get_inpost_locker('correct_id') => Hash

InpostApi.get_inpost_locker('incorrect_id') => nil
  • require options: :id
3) Helper
<%= inpost_lockers_tag(1) %>
  • require options: :type

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published