sncf 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67268cd1f99364185d187b698ad29e74410b89ec
4
- data.tar.gz: 9de2b1a2935e201953c344b0a836e6ea31458b2c
3
+ metadata.gz: c0ebb101165159e3c8179e93f18a4891e222b655
4
+ data.tar.gz: 96b4e851249d3686a9dc2ae3a1c269512e29c3bc
5
5
  SHA512:
6
- metadata.gz: 736b834f00c37a36121512ead4bb49162f553e08b288b02c4cc2f6ba9ab2d8fd6d46242a137bc0011e47305d95f6a601377fd5465cf37a02b58db6ebeee600c9
7
- data.tar.gz: 4e8b605ae94267cc83f591d1dd476456dd83e41cebaa51fd42e9256e8163408f6edaf1de311a33b545d14d1aee43d52ed4ca16fb6bb8801a54f1a04933f313b9
6
+ metadata.gz: a142907f567191d2d6828043feb4ec8f9cf172821368b4bf156c6b671d9d600413946c326063aea9f4642f3ec94dc3f88571feb40f3782447ba6edbc183543a2
7
+ data.tar.gz: c2f5c562650e5a118f769dde5a5d7a2955518ce1ff736c2913f25ee89b888682903689b7abb91bafc65c238287645ae74c2c33047e0524c53bc8544f55ef5256
data/README.md CHANGED
@@ -1,4 +1,10 @@
1
- # Sncf ruby API
1
+ # SNCF Open Data API Ruby wrapper
2
+
3
+ # This gem in currently in beta, it may contains bugs, do not use in production.
4
+
5
+ # 1.0.0 release is due to Fri, 03 Jul 2015
6
+
7
+ [![Gem Version](https://badge.fury.io/rb/sncf.svg)](http://badge.fury.io/rb/sncf)
2
8
 
3
9
  Ruby gem to use easily the SNCF Open Data API with Ruby.
4
10
 
@@ -3,9 +3,9 @@ require 'oj'
3
3
 
4
4
  module Sncf
5
5
  class ApiClient
6
- HOST_URL = 'https://api.sncf.com'
7
- BASE_PATH = 'v1'
8
- PLAN = {
6
+ BASE_URL = 'https://api.sncf.com'
7
+ VERSION_PATH = 'v1'
8
+ PLAN = {
9
9
  name: 'Free',
10
10
  limits: {
11
11
  per_day: 3_000,
@@ -13,8 +13,6 @@ module Sncf
13
13
  }
14
14
  }
15
15
 
16
- # => 3aa53f6d-13f1-486b-8a68-a781842cbe73
17
-
18
16
  attr_reader :api_key
19
17
 
20
18
  def initialize(api_key)
@@ -27,7 +25,10 @@ module Sncf
27
25
 
28
26
  def quotas
29
27
  @quotas ||= begin
30
- { per_day: PLAN[:limits][:per_day], per_month: PLAN[:limits][:per_month] }
28
+ {
29
+ per_day: PLAN[:limits][:per_day],
30
+ per_month: PLAN[:limits][:per_month]
31
+ }
31
32
  end
32
33
  end
33
34
 
@@ -45,9 +46,10 @@ module Sncf
45
46
 
46
47
  def construct_formated_url(path, additional_params)
47
48
  if additional_params.nil?
48
- "#{HOST_URL}/#{BASE_PATH}/#{path}"
49
+ "#{BASE_URL}/#{VERSION_PATH}/#{path}"
49
50
  else
50
- "#{HOST_URL}/#{BASE_PATH}/#{path}?#{additional_params.to_query}"
51
+ "#{BASE_URL}/#{VERSION_PATH}/#{path}?#{additional_params.to_query}"
51
52
  end
53
+ end
52
54
  end
53
55
  end
data/lib/sncf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sncf
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sncf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rémi Delhaye
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-25 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http