saharak-manoo / etracking-ruby

eTracking for ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eTrackings API for Ruby

Gem Downloads Gem-version

Introduction

The ETrackings API for Ruby makes it easy to develop using ETrackings API

Documentation

See the official API documentation for more information

Installation

Add this line to your application's Gemfile:

gem 'etrackings'

And then execute:

bundle install

Or install it yourself as:

gem install etrackings

Synopsis

Usage:

# example.rb

class Example
  def client
    @client ||= Etrackings::Client.new do |config|
      config.api_key = ENV["etrackings_api_key"]
      config.key_secret = ENV["etrackings_key_secret"]
      config.language = ENV["etrackings_language"] || 'TH'
    end
  end

  def track_by_courier(courier = "dhl-express", tracking_no = "THBCA12652305942")
    # courier ให้ใส่ชื่อขนส่งที่ระบบรองรับ
    client.track(courier, tracking_no)
    # ดูเพิ่มเติม https://apps.etrackings.com/docs/trackings
  end

  def track_kerry_express(tracking_no = "THBCA12652305942")
    # สามารถ เรียกชื่อขนส่งได้เลย
    client.kerry_express(tracking_no)
    # ดูเพิ่มเติม https://apps.etrackings.com/docs/trackings
  end
end

About

eTracking for ruby


Languages

Language:Ruby 100.0%