Class: PortaText::Command::Api::CampaignLifecycle
- Defined in:
- lib/portatext/command/api/campaign_lifecycle.rb
Overview
The campaigns/:id/lifecycle endpoint. github.com/PortaText/docs/wiki/REST-API#api_campaigns_lifecycle
- Author
-
Marcelo Gornstein ([email protected])
- Copyright
-
Copyright © 2015 PortaText
- License
-
Apache-2.0
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #cancel ⇒ Object
- #endpoint(_method) ⇒ Object
- #id(id) ⇒ Object
- #pause ⇒ Object
- #resume ⇒ Object
- #start ⇒ Object
Methods inherited from Base
#accept_content_type, #body, #content_type, #delete, #get, #initialize, #patch, #post, #put, #set
Constructor Details
This class inherits a constructor from PortaText::Command::Base
Instance Method Details
#cancel ⇒ Object
27 28 29 |
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 27 def cancel action 'cancel' end |
#endpoint(_method) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 31 def endpoint(_method) raise 'Campaign id cant be null' if @args[:id].nil? id = @args[:id] @args.delete :id "campaigns/#{id}/lifecycle" end |
#id(id) ⇒ Object
11 12 13 |
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 11 def id(id) set :id, id end |
#pause ⇒ Object
19 20 21 |
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 19 def pause action 'pause' end |
#resume ⇒ Object
23 24 25 |
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 23 def resume action 'resume' end |
#start ⇒ Object
15 16 17 |
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 15 def start action 'start' end |