Class: Drip::Client
- Inherits:
-
Object
- Object
- Drip::Client
- Includes:
- Accounts, Broadcasts, CampaignSubscriptions, Campaigns, Conversions, CustomFields, Events, Forms, Orders, Subscribers, Tags, Webhooks, WorkflowTriggers, Workflows
- Defined in:
- lib/drip/client.rb,
lib/drip/client/tags.rb,
lib/drip/client/forms.rb,
lib/drip/client/events.rb,
lib/drip/client/orders.rb,
lib/drip/client/accounts.rb,
lib/drip/client/webhooks.rb,
lib/drip/client/campaigns.rb,
lib/drip/client/workflows.rb,
lib/drip/client/broadcasts.rb,
lib/drip/client/conversions.rb,
lib/drip/client/subscribers.rb,
lib/drip/client/custom_fields.rb,
lib/drip/client/workflow_triggers.rb,
lib/drip/client/campaign_subscriptions.rb
Defined Under Namespace
Modules: Accounts, Broadcasts, CampaignSubscriptions, Campaigns, Conversions, CustomFields, Events, Forms, Orders, Subscribers, Tags, Webhooks, WorkflowTriggers, Workflows
Constant Summary collapse
- REDIRECT_LIMIT =
10
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#http_open_timeout ⇒ Object
Returns the value of attribute http_open_timeout.
-
#http_timeout ⇒ Object
Returns the value of attribute http_timeout.
-
#url_prefix ⇒ Object
Returns the value of attribute url_prefix.
Instance Method Summary collapse
- #content_type ⇒ Object
- #delete(url, options = {}) ⇒ Object
- #generate_resource(key, *args) ⇒ Object
- #get(url, options = {}) ⇒ Object
-
#initialize(options = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
- #post(url, options = {}) ⇒ Object
- #put(url, options = {}) ⇒ Object
Methods included from WorkflowTriggers
#create_workflow_trigger, #update_workflow_trigger, #workflow_triggers
Methods included from Workflows
#activate_workflow, #pause_workflow, #remove_subscriber_workflow, #start_subscriber_workflow, #workflow, #workflows
Methods included from Webhooks
#create_webhook, #delete_webhook, #webhook, #webhooks
Methods included from Tags
#apply_tag, #remove_tag, #tags
Methods included from Subscribers
#create_or_update_subscriber, #create_or_update_subscribers, #delete_subscriber, #subscribe, #subscriber, #subscribers, #unsubscribe, #unsubscribe_from_all, #unsubscribe_subscribers
Methods included from Orders
#create_or_update_order, #create_or_update_orders, #create_or_update_refund
Methods included from Forms
Methods included from Events
#event_actions, #track_event, #track_events
Methods included from CustomFields
Methods included from Conversions
Methods included from CampaignSubscriptions
Methods included from Campaigns
#activate_campaign, #campaign, #campaign_subscribers, #campaigns, #pause_campaign
Methods included from Broadcasts
Methods included from Accounts
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
42 43 44 45 46 47 48 49 50 |
# File 'lib/drip/client.rb', line 42 def initialize( = {}) @account_id = [:account_id] @access_token = [:access_token] @api_key = [:api_key] @url_prefix = [:url_prefix] || "https://api.getdrip.com/v2/" @http_open_timeout = [:http_open_timeout] @http_timeout = [:http_timeout] yield(self) if block_given? end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
40 41 42 |
# File 'lib/drip/client.rb', line 40 def access_token @access_token end |
#account_id ⇒ Object
Returns the value of attribute account_id.
40 41 42 |
# File 'lib/drip/client.rb', line 40 def account_id @account_id end |
#api_key ⇒ Object
Returns the value of attribute api_key.
40 41 42 |
# File 'lib/drip/client.rb', line 40 def api_key @api_key end |
#http_open_timeout ⇒ Object
Returns the value of attribute http_open_timeout.
40 41 42 |
# File 'lib/drip/client.rb', line 40 def http_open_timeout @http_open_timeout end |
#http_timeout ⇒ Object
Returns the value of attribute http_timeout.
40 41 42 |
# File 'lib/drip/client.rb', line 40 def http_timeout @http_timeout end |
#url_prefix ⇒ Object
Returns the value of attribute url_prefix.
40 41 42 |
# File 'lib/drip/client.rb', line 40 def url_prefix @url_prefix end |
Instance Method Details
#content_type ⇒ Object
56 57 58 |
# File 'lib/drip/client.rb', line 56 def content_type 'application/vnd.api+json' end |
#delete(url, options = {}) ⇒ Object
72 73 74 |
# File 'lib/drip/client.rb', line 72 def delete(url, = {}) make_request(Net::HTTP::Delete, make_uri(url), ) end |
#generate_resource(key, *args) ⇒ Object
52 53 54 |
# File 'lib/drip/client.rb', line 52 def generate_resource(key, *args) { key => args } end |
#get(url, options = {}) ⇒ Object
60 61 62 |
# File 'lib/drip/client.rb', line 60 def get(url, = {}) make_request(Net::HTTP::Get, make_uri(url), ) end |
#post(url, options = {}) ⇒ Object
64 65 66 |
# File 'lib/drip/client.rb', line 64 def post(url, = {}) make_request(Net::HTTP::Post, make_uri(url), ) end |
#put(url, options = {}) ⇒ Object
68 69 70 |
# File 'lib/drip/client.rb', line 68 def put(url, = {}) make_request(Net::HTTP::Put, make_uri(url), ) end |