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.



10
11
12
# File 'lib/soapy_cake/admin_batched.rb', line 10

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



68
69
70
71
72
73
74
# File 'lib/soapy_cake/admin_batched.rb', line 68

def method_missing(name, method_opts = {}, limit = nil)
  if respond_to_missing?(name)
    BatchedRequest.new(admin, name, method_opts, limit).to_enum
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(name) ⇒ Boolean

Returns:

  • (Boolean)


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

def respond_to_missing?(name)
  ALLOWED_METHODS.include?(name)
end