Class: Mrkt::Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CrudAssetFolders

#create_folder, #delete_folder, #get_folder_by_id, #get_folder_by_name

Methods included from CrudAssetStaticLists

#create_static_list, #delete_static_list, #get_static_list_by_id, #get_static_list_by_name

Methods included from CrudProgramMembers

#createupdate_program_members, #describe_program_members, #get_program_members

Methods included from CrudPrograms

#browse_programs, #get_program_by_id

Methods included from CrudCustomActivities

#create_custom_activity, #get_list_of_custom_activity_types

Methods included from CrudCustomObjects

#createupdate_custom_objects, #delete_custom_objects, #describe_custom_object, #get_custom_objects, #get_list_of_custom_objects

Methods included from ImportCustomObjects

#import_custom_object, #import_custom_object_failures, #import_custom_object_status, #import_custom_object_warnings

Methods included from ImportLeads

#import_lead, #import_lead_failures, #import_lead_status, #import_lead_warnings

Methods included from CrudLists

#add_leads_to_list, #get_leads_by_list, #remove_leads_from_list

Methods included from CrudLeads

#associate_lead, #createupdate_leads, #delete_leads, #describe_lead, #get_lead_by_id, #get_leads, #merge_leads

Methods included from CrudCampaigns

#request_campaign

Methods included from CrudActivities

#get_activities, #get_activity_types, #get_deleted_leads, #get_paging_token

Methods included from CrudHelpers

#json_payload, #map_lead_ids, #post_json

Methods included from Authentication

#add_authorization, #authenticate, #authenticate!, #authenticated?, #authentication_params, #retry_authentication, #valid_token?

Methods included from Connection

#connection, #init_connection, #options

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/mrkt.rb', line 40

def initialize(options = {})
  @host = options.fetch(:host)

  @client_id = options.fetch(:client_id)
  @client_secret = options.fetch(:client_secret)
  @partner_id = options[:partner_id]

  @retry_authentication = options.fetch(:retry_authentication, false)
  @retry_authentication_count = options.fetch(:retry_authentication_count, 3).to_i
  @retry_authentication_wait_seconds = options.fetch(:retry_authentication_wait_seconds, 0).to_i

  @debug = options[:debug]

  @logger = options[:logger]
  @log_options = options[:log_options]

  @options = options
end

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



38
39
40
# File 'lib/mrkt.rb', line 38

def debug
  @debug
end

Instance Method Details

#merge_params(params, optional) ⇒ Object



59
60
61
# File 'lib/mrkt.rb', line 59

def merge_params(params, optional)
  params.merge(optional.keep_if { |_key, value| value })
end