Class: PortaText::Command::Api::CampaignLifecycle

Inherits:
Base
  • Object
show all
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

#client

Instance Method Summary collapse

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

#cancelObject



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

#pauseObject



19
20
21
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 19

def pause
  action 'pause'
end

#resumeObject



23
24
25
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 23

def resume
  action 'resume'
end

#startObject



15
16
17
# File 'lib/portatext/command/api/campaign_lifecycle.rb', line 15

def start
  action 'start'
end