eventbrite_ruby 0.0.1 → 0.1.3

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
- SHA1:
3
- metadata.gz: '0987740ee0216cb8e69530b544105b5635d483a5'
4
- data.tar.gz: 8b12e996f4658a03e381ee79a0131a4440d7fe09
2
+ SHA256:
3
+ metadata.gz: 7fbedefdd39223deb9d2e0dcc801b654bfcc890cdcfbd1e1d9df0b7b5a0a7b03
4
+ data.tar.gz: af27a5673ed648674cf07007982e01af32871b3b5f68daed2e10373d777b02aa
5
5
  SHA512:
6
- metadata.gz: 381b9ac4ca3e7d6949a0b8fa6c177f2c3a0a5c878f0f44ddc522999762bb503e9c5fae70087d5fb690498b5cb615b6a623b51cb4446b7502a6a1f4d0accd420b
7
- data.tar.gz: d6214cdf577684aacffaad52851a6f0e683b53869602bc691d70f96bfeccb1ce4f6a44da665030e121897ff2c18e2cc2f784da45d746016660ac3d699f509b1d
6
+ metadata.gz: 3887c41909d625fe75693d6e3ab02689770c9afe7015ff4759c99bf58be1b635366e25d057e63d47f8b67356890c4984c8f35cfa90a8cea4e2bd6f3f1fab0820
7
+ data.tar.gz: 22c270aebbbe452413149b5645fa20b0b08958ea363c83d4a6304dc089ca8cb1e9454c6560bd1778760b1df1bdfd727be6aa843e77ffd5ff88146faa13574a74
data/.gitignore CHANGED
File without changes
data/.travis.yml CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # EventbriteRuby
2
2
 
3
- **Ruby wrapper for Eventbrite REST API**
3
+ **Ruby wrapper for Eventbrite REST API**
4
4
 
5
5
  ## Installation
6
6
 
@@ -51,16 +51,34 @@ OR:
51
51
  ```
52
52
 
53
53
 
54
- Search events:
54
+ Supported endpoints:
55
55
  ```
56
- EventbriteRuby::Events.new.search({q: "Malaga", "location.address": "Malaga"})
57
- EventbriteRuby::Events.new.create({...})
58
- EventbriteRuby::Events.new.find({'ID')
59
- EventbriteRuby::Events.new.update_event({id: "...", "location.address": "Malaga"})
56
+ EventbriteRuby::Event.search({q: "Malaga", "location.address": "Malaga"})
57
+ EventbriteRuby::Event.create({...})
58
+ EventbriteRuby::Event.find({'ID')
59
+ EventbriteRuby::Event.update_event({id: "...", "location.address": "Malaga"})
60
+
61
+ EventbriteRuby::Category.all({...})
62
+ EventbriteRuby::Category.find({...})
63
+ EventbriteRuby::Category.subcategories({...})
64
+ EventbriteRuby::Category.find_subcategory({...})
65
+
66
+ EventbriteRuby::Format.all({...})
67
+ EventbriteRuby::Format.find({...})
68
+
69
+ EventbriteRuby::Notification.all({...})
70
+
71
+ EventbriteRuby::Order.find({...})
72
+
73
+ EventbriteRuby::Media.find({...})
74
+ EventbriteRuby::Media.upload({...})
75
+
76
+ #Pagination:
77
+ EventbriteRuby::Category.subcategories({continuation: "eyJwYWdlIjogMn0"})
78
+
60
79
 
61
80
  # more will be added soon...
62
81
  ```
63
- # Supported endpoints
64
82
 
65
83
  ## Development
66
84
 
data/Rakefile CHANGED
File without changes
File without changes
@@ -5,7 +5,12 @@ require 'active_support/core_ext/hash/indifferent_access'
5
5
 
6
6
  require 'eventbrite_ruby/version'
7
7
  require 'eventbrite_ruby/client'
8
- require 'eventbrite_ruby/events'
8
+ require 'eventbrite_ruby/event'
9
+ require 'eventbrite_ruby/category'
10
+ require 'eventbrite_ruby/format'
11
+ require 'eventbrite_ruby/media'
12
+ require 'eventbrite_ruby/order'
13
+ require 'eventbrite_ruby/notification'
9
14
 
10
15
  module EventbriteRuby
11
16
  class << self
@@ -1,6 +1,6 @@
1
1
  module EventbriteRuby
2
2
  class Client
3
- attr_accessor :personal_key, :password
3
+ attr_accessor :personal_key
4
4
 
5
5
  def initialize(personal_key: nil)
6
6
  @personal_key = personal_key || EventbriteRuby.personal_key
@@ -16,7 +16,11 @@ module EventbriteRuby
16
16
  end
17
17
  end
18
18
 
19
- def post(url, data)
19
+ def post(url, data = {})
20
+ if data[:continuation].present?
21
+ url = "#{url}?continuation=#{data[:continuation]}"
22
+ data.delete(:continuation)
23
+ end
20
24
  connection.post do |req|
21
25
  req.url url
22
26
  req.headers['Content-Type'] = 'application/json'
@@ -24,7 +28,11 @@ module EventbriteRuby
24
28
  end
25
29
  end
26
30
 
27
- def get(url, data)
31
+ def get(url, data = {})
32
+ if data[:continuation].present?
33
+ url = "#{url}?continuation=#{data[:continuation]}"
34
+ data.delete(:continuation)
35
+ end
28
36
  connection.get do |req|
29
37
  req.url url
30
38
  req.headers['Content-Type'] = 'application/json'
@@ -0,0 +1,33 @@
1
+ module EventbriteRuby
2
+ class Category
3
+ class << self
4
+
5
+ # Returns a list of category as categories, including subcategories nested.
6
+ def all(params = {})
7
+ client.get("v3/categories/", params)
8
+ end
9
+
10
+ # Gets a category by ID as category.
11
+ def find(params = {})
12
+ client.get("v3/ategories/", params)
13
+ end
14
+
15
+ # Returns a list of subcategory as subcategories.
16
+ def subcategories(params = {})
17
+ client.get("v3/subcategories/", params)
18
+ end
19
+
20
+ # Gets a subcategory by ID as subcategory.
21
+ def find_subcategory(params = {})
22
+ client.get("v3/subcategories/", params)
23
+ end
24
+
25
+ private
26
+
27
+ def client
28
+ EventbriteRuby::Client.new
29
+ end
30
+
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,32 @@
1
+ module EventbriteRuby
2
+ class Event
3
+ class << self
4
+
5
+ # Allows you to retrieve a paginated response of public event objects from across Eventbrite’s directory
6
+ def search(params = {})
7
+ client.get("v3/events/search/", params)
8
+ end
9
+
10
+ # Makes a new event, and returns an event for the specified event. Does not support the creation of repeating event series.
11
+ def create(params = {})
12
+ client.post("v3/events/", params)
13
+ end
14
+
15
+ # Updates an event. Returns an event for the specified event. Does not support updating a repeating event series parent (see POST /series/:id/).
16
+ def find(params = {})
17
+ client.get("v3/events/", params)
18
+ end
19
+
20
+ def update_event(params = {})
21
+ client.post("v3/events/", params)
22
+ end
23
+
24
+ private
25
+
26
+ def client
27
+ EventbriteRuby::Client.new
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,21 @@
1
+ module EventbriteRuby
2
+ class Format
3
+ class << self
4
+
5
+ def all(params = {})
6
+ client.get("v3/formats/", params)
7
+ end
8
+
9
+ def find(params = {})
10
+ client.get("v3/formats/", params)
11
+ end
12
+
13
+ private
14
+
15
+ def client
16
+ EventbriteRuby::Client.new
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module EventbriteRuby
2
+ class Media
3
+ class << self
4
+
5
+ def find(params = {})
6
+ client.get("v3/media/", params)
7
+ end
8
+
9
+ def upload(params = {})
10
+ client.post("v3//media/upload/", params)
11
+ end
12
+
13
+ private
14
+
15
+ def client
16
+ EventbriteRuby::Client.new
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ module EventbriteRuby
2
+ class Notification
3
+ class << self
4
+
5
+ def all(params = {})
6
+ client.get("v3/users/me/notifications/", params)
7
+ end
8
+
9
+ private
10
+
11
+ def client
12
+ EventbriteRuby::Client.new
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ module EventbriteRuby
2
+ class Order
3
+ class << self
4
+
5
+ # Gets an order by ID an order object.
6
+ def find(params = {})
7
+ client.get("v3/orders/", params)
8
+ end
9
+
10
+ private
11
+
12
+ def client
13
+ EventbriteRuby::Client.new
14
+ end
15
+
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module EventbriteRuby
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventbrite_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugeniu Tambur
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-26 00:00:00.000000000 Z
11
+ date: 2018-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,7 +114,12 @@ files:
114
114
  - eventbrite_ruby.gemspec
115
115
  - lib/eventbrite_ruby.rb
116
116
  - lib/eventbrite_ruby/Client.rb
117
- - lib/eventbrite_ruby/events.rb
117
+ - lib/eventbrite_ruby/category.rb
118
+ - lib/eventbrite_ruby/event.rb
119
+ - lib/eventbrite_ruby/format.rb
120
+ - lib/eventbrite_ruby/media.rb
121
+ - lib/eventbrite_ruby/notification.rb
122
+ - lib/eventbrite_ruby/order.rb
118
123
  - lib/eventbrite_ruby/version.rb
119
124
  homepage: https://github.com/RTJ/eventbrite_ruby
120
125
  licenses:
@@ -136,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
141
  version: '0'
137
142
  requirements: []
138
143
  rubyforge_project:
139
- rubygems_version: 2.6.14
144
+ rubygems_version: 2.7.6
140
145
  signing_key:
141
146
  specification_version: 4
142
147
  summary: Eventbrite API client.
@@ -1,25 +0,0 @@
1
- module EventbriteRuby
2
- class Events
3
-
4
- def initialize
5
- @client = EventbriteRuby::Client.new
6
- end
7
-
8
- def search(params)
9
- @client.get("v3/events/search/", params)
10
- end
11
-
12
- def create(params)
13
- @client.post("v3/events/", params)
14
- end
15
-
16
- def find(id)
17
- @client.get("v3/events/", {id: id})
18
- end
19
-
20
- def update_event(params)
21
- @client.post("v3/events/", params)
22
- end
23
-
24
- end
25
- end