Class: SoapyCake::AdminBatched

Inherits:
Object
  • Object
show all
Defined in:
lib/soapy_cake/admin_batched.rb

Defined Under Namespace

Classes: BatchedRequest

Constant Summary collapse

ALLOWED_METHODS =
%i(
  advertisers affiliates campaigns offers creatives clicks
  conversions events caps exchange_rates
).freeze

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ AdminBatched

Returns a new instance of AdminBatched.



8
9
10
# File 'lib/soapy_cake/admin_batched.rb', line 8

def initialize(opts = {})
  @opts = opts
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, method_opts = {}, limit = nil) ⇒ Object



62
63
64
65
66
# File 'lib/soapy_cake/admin_batched.rb', line 62

def method_missing(name, method_opts = {}, limit = nil)
  fail Error, "Invalid method #{name}" unless ALLOWED_METHODS.include?(name)

  BatchedRequest.new(admin, name, method_opts, limit).to_enum
end