Class: EventbriteApiClient
- Inherits:
-
Object
- Object
- EventbriteApiClient
- Includes:
- HTTParty
- Defined in:
- lib/eventbrite_api_client.rb,
lib/eventbrite_api_client/version.rb
Defined Under Namespace
Classes: Params
Constant Summary collapse
- VERSION =
"0.1.2"
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #get(params = {}) ⇒ Object
-
#initialize(options) ⇒ EventbriteApiClient
constructor
A new instance of EventbriteApiClient.
- #method_missing(method_sym, *args) ⇒ Object
- #post(params = {}) ⇒ Object
Constructor Details
#initialize(options) ⇒ EventbriteApiClient
Returns a new instance of EventbriteApiClient.
12 13 14 15 16 17 |
# File 'lib/eventbrite_api_client.rb', line 12 def initialize() self.class.headers 'Authorization' => "Bearer #{options[:auth_token]}" @debug = [:debug] @path = "" end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *args) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/eventbrite_api_client.rb', line 27 def method_missing(method_sym, *args) them = self.dup them.path = "#{them.path}/#{method_sym.to_s}" them.path = "#{them.path}/#{args.first}" if args.first them end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
10 11 12 |
# File 'lib/eventbrite_api_client.rb', line 10 def path @path end |
Instance Method Details
#get(params = {}) ⇒ Object
19 20 21 |
# File 'lib/eventbrite_api_client.rb', line 19 def get(params = {}) wrap_request(params) { |path, querystring| self.class.get(path, querystring) } end |
#post(params = {}) ⇒ Object
23 24 25 |
# File 'lib/eventbrite_api_client.rb', line 23 def post(params = {}) wrap_request(params) { |path, querystring| self.class.post(path, querystring) } end |