Class: ActiveCampaignWrapper::Core::ListGroupGateway
- Inherits:
-
Object
- Object
- ActiveCampaignWrapper::Core::ListGroupGateway
- Defined in:
- lib/active_campaign_wrapper/core/list_group_gateway.rb
Instance Method Summary collapse
- #all(**params) ⇒ Object
- #create(params) ⇒ Object
- #delete(list_group_id) ⇒ Object
- #find(list_group_id) ⇒ Object
-
#initialize(client) ⇒ ListGroupGateway
constructor
A new instance of ListGroupGateway.
Constructor Details
#initialize(client) ⇒ ListGroupGateway
Returns a new instance of ListGroupGateway.
6 7 8 9 |
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 6 def initialize(client) @client = client @config = client.config end |
Instance Method Details
#all(**params) ⇒ Object
11 12 13 |
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 11 def all(**params) @config.get('/listGroups', query: params) end |
#create(params) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 15 def create(params) params = { list_group: params } @config.post( '/listGroups', body: ActiveCampaignWrapper::Helpers.normalize_body(params) ) end |
#delete(list_group_id) ⇒ Object
23 24 25 |
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 23 def delete(list_group_id) @config.delete("/listGroups/#{list_group_id}") end |
#find(list_group_id) ⇒ Object
27 28 29 |
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 27 def find(list_group_id) @config.get("/listGroups/#{list_group_id}") end |