lib/eventbrite_sdk/resource.rb in eventbrite_sdk-3.1.4 vs lib/eventbrite_sdk/resource.rb in eventbrite_sdk-3.1.5
- old
+ new
@@ -25,21 +25,21 @@
#
# def publish
# !new? && EventbriteSDK.post(url: path('unpublish'))
# end
def self.define_api_actions(*actions)
- req = lambda do |inst, postfix|
- inst.instance_eval { !new? && EventbriteSDK.post(url: path(postfix)) }
+ req = lambda do |inst, postfix, opts|
+ inst.instance_eval { !new? && EventbriteSDK.post(opts.merge(url: path(postfix))) }
end
actions.each do |action|
if action.is_a?(Hash)
method_name, postfix_path = action.flatten
else
method_name = postfix_path = action
end
- define_method(method_name) { req.call(self, postfix_path) }
+ define_method(method_name) { |opts = {}| req.call(self, postfix_path, opts) }
end
end
def initialize(hydrated_attrs = {})
reload hydrated_attrs