class Workarea::MailChimp::BogusRequest

Attributes

api_endpoint[RW]
api_key[RW]
debug[RW]
faraday_adapter[RW]
logger[RW]
open_timeout[RW]
proxy[RW]
symbolize_keys[RW]
timeout[RW]

Public Class Methods

new(*) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 4
def initialize(*)
  @path_parts = []
end

Protected Class Methods

method_missing(sym, *args, &block) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 67
def method_missing(sym, *args, &block)
  new.send(sym, *args, &block)
end
respond_to_missing?(method_name, include_private = false) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 71
def respond_to_missing?(method_name, include_private = false)
  true
end

Public Instance Methods

create(params: nil, headers: nil, body: nil) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 33
def create(params: nil, headers: nil, body: nil)
  BogusAPIRequest.new(builder: self).post(params: params, headers: headers, body: body)
  reset
end
delete(params: nil, headers: nil) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 53
def delete(params: nil, headers: nil)
  BogusAPIRequest.new(builder: self).delete(params: params, headers: headers)
  reset
end
method_missing(method, *args) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 8
def method_missing(method, *args)
  # To support underscores, we replace them with hyphens when calling the API
  @path_parts << method.to_s.gsub("_", "-").downcase
  @path_parts << args if args.length > 0
  @path_parts.flatten!

  self
end
path() click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 29
def path
  @path_parts.join('/')
end
respond_to_missing?(method_name, include_private = false) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 17
def respond_to_missing?(method_name, include_private = false)
  true
end
retrieve(params: nil, headers: nil) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 48
def retrieve(params: nil, headers: nil)
  BogusAPIRequest.new(builder: self).get(params: params, headers: headers)
  reset
end
send(*args) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 21
def send(*args)
  if args.length == 0
    method_missing(:send, args)
  else
    __send__(*args)
  end
end
update(params: nil, headers: nil, body: nil) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 38
def update(params: nil, headers: nil, body: nil)
  BogusAPIRequest.new(builder: self).patch(params: params, headers: headers, body: body)
  reset
end
upsert(params: nil, headers: nil, body: nil) click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 43
def upsert(params: nil, headers: nil, body: nil)
  BogusAPIRequest.new(builder: self).put(params: params, headers: headers, body: body)
  reset
end

Protected Instance Methods

reset() click to toggle source
# File lib/integrations/workarea/mail_chimp/bogus_request.rb, line 60
def reset
  @path_parts = []
end