Project

ekispert

0.0
No commit activity in last 3 years
No release in over 3 years
SDK for Ekispert Web Service
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0
~> 0.59.0

Runtime

>= 0.7.4, < 1.0
~> 1.8.2
 Project Readme

ekispert

A module for using the EkispertWebService API.

This SDK development is moving at a very slow pace and we haven't reached version 1.0 yet. There are often backward-incompatible changes between minor releases. Please use after understanding the it enough.

Installation

Add this line to your application's Gemfile:

gem 'ekispert'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ekispert

Settings

$ echo export EKISPERT_API_KEY=api_key >> ~/.bash_profile

# If you need to access Web through proxy
$ echo export HTTP_PROXY="http://www.example.com:8080" >> ~/.bash_profile

$ source ~/.bash_profile

Usage

Don't forget to require ekispert.

require 'ekispert'

Search Station

The base of this module is its /v1/xml/station API. -> Ekispert web service reference.

station_list = Ekispert::Point::Station.get(code: '22828')

p station_list[0].name
#=> "東京"

station_list[0].prefecture.name
#=> "東京都"

jr_station_list = Ekispert::Point::Station.get(corporationName: 'JR', limit: 2)

p jr_station_list[0].name
#=> "相生(兵庫県)"

p jr_station_list[1].name
#=> "相賀"

Search Course

The base of this module is its /v1/xml/search/course/extreme API. -> Ekispert web service reference.

course_list = Ekispert::Course.get(viaList: '22828:22741', answerCount: 1)

course_list.each_with_index do |course, i|
  price_list = course.price_list
  route = course.route
  point_list = route.point_list
  line_list = route.line_list

  line_list.each_with_index do |line, j|
    puts "#{line.departure_state.datetime.strftime('%H:%M')} #{point_list[j].station.name}"
    if line.line_symbol
      puts " | [#{line.line_symbol.name}] #{line.name}"
    else
      puts " | #{line.name}"
    end
  end
  puts "#{line_list[-1].arrival_state.datetime.strftime('%H:%M')} #{point_list[-1].station.name}"
end

# 12:00 東京
#  | [JC] JR中央線中央特快・高尾行
# 12:16 新宿

And more...

If you want to see more sample code, see the /example directory.

Supported Ruby Versions

This library supports and is tested against the following Ruby inplementations:

  • Ruby 2.5
  • Ruby 2.6

Document

Ekispert web service reference

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/EkispertWebService/ekispert-sdk-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the ekispert project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.