flyticket 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -9
- data/lib/flyticket/Changelog.md +4 -0
- data/lib/flyticket/endpoint.rb +2 -2
- data/lib/flyticket/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bb6c78eeabb1e762624f79ee83c6b73c990eeb5
|
4
|
+
data.tar.gz: c81aff0cd54e0f9fc87b8a2f78de07db2dd23888
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1456746003bdcfc11222eeec5e3c68b9185c58164c3edcab3577ae87b35caa6cc120b71336d88479b76c4f2f7d1737b8a875fed013a899d95461f42717497fd4
|
7
|
+
data.tar.gz: 90ab30f5e11a81042b1041d8a2b42ac1c28bbff26a06ee39660f1a91cc302fb9021a172ad49f40934d9748fef5ae520e05dbf4c5d465ecb987736e1a703d6611
|
data/README.md
CHANGED
@@ -11,8 +11,7 @@ looked at were defunct.
|
|
11
11
|
|
12
12
|
## Example Usage
|
13
13
|
|
14
|
-
|
15
|
-
use it like so:
|
14
|
+
To query for events, use it like so:
|
16
15
|
|
17
16
|
```ruby
|
18
17
|
past = Flyticket::Events.past(venue_id: 1, max_results: 3)
|
@@ -20,10 +19,9 @@ past.first.facebook_event_id # --> FB event id for this venue's last show
|
|
20
19
|
```
|
21
20
|
|
22
21
|
Flyticket is opinionated about the result format -- it discards Ticketfly's
|
23
|
-
outer wrapper (used for pagination) and converts the top-level
|
24
|
-
|
25
|
-
|
26
|
-
this:
|
22
|
+
outer wrapper (used for pagination) and converts the top-level hashes and
|
23
|
+
the nested org and venue hashes into OpenStructs, leaving deeper hashes alone.
|
24
|
+
So retrieving a deeply-nested attributes looks like this:
|
27
25
|
|
28
26
|
```ruby
|
29
27
|
next_event = Flyticket::Events.upcoming(venue_id: 1, max_results: 1).first
|
@@ -35,24 +33,36 @@ upcoming.first.venue.name # --> 'Brooklyn Bowl'
|
|
35
33
|
|
36
34
|
Note how in the first example, `image` is a method, but deeper properties are
|
37
35
|
accessed using hash keys. In the second example, because `venue` is a struct,
|
38
|
-
the venue name can be accessed using a method (although `[:name]` works too
|
36
|
+
the venue name can be accessed using a method (although `[:name]` works too).
|
37
|
+
|
38
|
+
#### Endpoints:
|
39
|
+
* Events.list(options)
|
40
|
+
* Events.upcoming(options)
|
41
|
+
* Events.featured(options)
|
42
|
+
* Events.past(options)
|
43
|
+
* Events.just_announced(options)
|
44
|
+
* Events.event(options)
|
45
|
+
* Orgs.list(options)
|
46
|
+
* Venues.list(options)
|
39
47
|
|
40
48
|
#### Some useful properties:
|
41
49
|
* org_id
|
42
50
|
* venue_id
|
43
51
|
* event_id
|
44
|
-
* max_results (capped by
|
52
|
+
* max_results (capped by Ticketfly at 1000)
|
45
53
|
* page_num (use when total results > max_results)
|
46
54
|
* from_date
|
47
55
|
* thru_date
|
48
56
|
|
49
57
|
## Notes
|
50
58
|
|
51
|
-
|
59
|
+
Not attempting semantic versioning just yet because the API may change. (In particular,
|
60
|
+
I may roll my own classes instead of using OpenStruct).
|
52
61
|
|
53
62
|
#### TODO
|
54
63
|
* [ ] make original json available
|
55
64
|
* [ ] handle fields & fieldGroup
|
65
|
+
* [ ] if ticketfly paginates, fetch extra & concatenate
|
56
66
|
* [ ] specs
|
57
67
|
|
58
68
|
## Contributing
|
data/lib/flyticket/Changelog.md
CHANGED
data/lib/flyticket/endpoint.rb
CHANGED
@@ -18,7 +18,7 @@ module Flyticket
|
|
18
18
|
base_uri.split('/').last
|
19
19
|
end
|
20
20
|
|
21
|
-
# Gets
|
21
|
+
# Gets many events
|
22
22
|
def self.get_many(fragment, options)
|
23
23
|
response = get fragment, query: query_string(options)
|
24
24
|
|
@@ -57,7 +57,7 @@ module Flyticket
|
|
57
57
|
end
|
58
58
|
|
59
59
|
# Raises an error if the response indicates a problem.
|
60
|
-
def self.handle_error
|
60
|
+
def self.handle_error(response)
|
61
61
|
if response['status'] == 'error'
|
62
62
|
raise TicketflyError.new(response)
|
63
63
|
end
|
data/lib/flyticket/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flyticket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Cipriano
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|