tiqets 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/CHANGELOG.md +6 -0
- data/README.md +9 -3
- data/lib/tiqets/client.rb +2 -2
- data/lib/tiqets/error.rb +2 -4
- data/lib/tiqets/resources/product.rb +2 -4
- data/lib/tiqets/version.rb +1 -1
- data/tiqets.gemspec +2 -0
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 243efec33ef0f3bfac4ab3e62b1945f4428a42e6
|
4
|
+
data.tar.gz: a553e2ed7e3c2ef1bc1803710723814a056e4e97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12a3ba5f9b3da267a7a01fa4f571ce2844197de4c97285e5b6d274c8e91d3fd17e1ea7a2564df99426175ded750ba210e24ed2254db8f06b37d924f2fe4cb4ea
|
7
|
+
data.tar.gz: ffd2b0b615f6448a09c11abd4027ddbb4c1c1aa2d99f024f8248d49ebf7abdde2f03348118809c54b16617cb5718460e3b35b536425d8366bf6ab27e0a4b3de2
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -4,7 +4,8 @@ A simple (unofficial) Ruby wrapper for the [Tiqets](https://www.tiqets.com) [API
|
|
4
4
|
|
5
5
|
[![Travis CI status](https://img.shields.io/travis/richardvenneman/tiqets.svg?style=flat-square)](https://travis-ci.org/richardvenneman/tiqets)
|
6
6
|
[![RubyGem](https://img.shields.io/gem/v/tiqets.svg?style=flat-square)](https://rubygems.org/gems/tiqets)
|
7
|
-
|
7
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/richardvenneman/tiqets.svg?style=flat-square)](https://codeclimate.com/github/richardvenneman/tiqets)
|
8
|
+
[![Code Climate](https://img.shields.io/codeclimate/coverage/github/richardvenneman/tiqets.svg?style=flat-square)](https://codeclimate.com/github/richardvenneman/tiqets/coverage)
|
8
9
|
|
9
10
|
Full 100% API coverage is not a direct goal as we're primarily developing this for our needs at [CitySpotters](https://www.cityspotters.com). Pull requests are definitely welcome.
|
10
11
|
|
@@ -40,12 +41,17 @@ Alternatively you can set the `TIQETS_API_KEY` environment variable and use the
|
|
40
41
|
|
41
42
|
### Products
|
42
43
|
|
43
|
-
####
|
44
|
+
#### client#find_product(product_id, params)
|
45
|
+
|
44
46
|
Finds a product by Product ID. Returns an object with the properties [described in the API documentation](https://api.tiqets.com/v2/docs/#the-product-object).
|
45
47
|
|
48
|
+
Requires the `lang` and `currency` params [as specified in the API documentation](https://api.tiqets.com/v2/docs/#get-a-single-product).
|
49
|
+
|
46
50
|
```ruby
|
47
|
-
@client.find_product(973698)
|
51
|
+
product = @client.find_product(973698)
|
48
52
|
# => #<Tiqets::Resources::Product::Product:0x007fe9c8438a00>
|
53
|
+
|
54
|
+
product.title #=> "Louvre Museum: Skip the line"
|
49
55
|
```
|
50
56
|
|
51
57
|
## Contributing
|
data/lib/tiqets/client.rb
CHANGED
@@ -17,8 +17,8 @@ module Tiqets
|
|
17
17
|
@connection ||= HTTP.auth("Authorization: Token #{@api_key}")
|
18
18
|
end
|
19
19
|
|
20
|
-
def get(url, response_key)
|
21
|
-
response = connection.get(@root + url)
|
20
|
+
def get(url, params, response_key)
|
21
|
+
response = connection.get(@root + url, params: params)
|
22
22
|
|
23
23
|
handle_response(response, response_key)
|
24
24
|
end
|
data/lib/tiqets/error.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Tiqets
|
2
2
|
class Error < Exception
|
3
|
-
attr_reader :code, :
|
3
|
+
attr_reader :code, :message
|
4
4
|
|
5
5
|
def initialize(code, error)
|
6
6
|
@code = code
|
@@ -10,9 +10,7 @@ module Tiqets
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def message
|
13
|
-
|
14
|
-
message += " (code: #{@code})" unless @code.nil?
|
15
|
-
message
|
13
|
+
"Tiqets API error: #{@error}"
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module Tiqets
|
2
2
|
module Resources
|
3
3
|
module Product
|
4
|
-
|
5
|
-
|
6
|
-
def find_product(id)
|
7
|
-
response = get("products/#{id}", 'product')
|
4
|
+
def find_product(id, params = {})
|
5
|
+
response = get("products/#{id}", params, 'product')
|
8
6
|
Product.new(response)
|
9
7
|
end
|
10
8
|
|
data/lib/tiqets/version.rb
CHANGED
data/tiqets.gemspec
CHANGED
@@ -27,4 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'guard-minitest', '~> 2'
|
28
28
|
spec.add_development_dependency 'rake', '~> 10.0'
|
29
29
|
spec.add_development_dependency 'webmock', '~> 3.0'
|
30
|
+
spec.add_development_dependency 'simplecov', '~> 0.15'
|
31
|
+
spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.0'
|
30
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiqets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Venneman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -94,6 +94,34 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.15'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.15'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: codeclimate-test-reporter
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.0.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.0.0
|
97
125
|
description: Ruby Tiqets API wrapper.
|
98
126
|
email:
|
99
127
|
- richardvenneman@me.com
|
@@ -104,6 +132,7 @@ files:
|
|
104
132
|
- ".gitignore"
|
105
133
|
- ".ruby-version"
|
106
134
|
- ".travis.yml"
|
135
|
+
- CHANGELOG.md
|
107
136
|
- Gemfile
|
108
137
|
- Guardfile
|
109
138
|
- LICENSE.txt
|