Class: Intercom::Service::Tag

Inherits:
BaseService show all
Includes:
ApiOperations::Delete, ApiOperations::Find, ApiOperations::FindAll, ApiOperations::List, ApiOperations::Save
Defined in:
lib/intercom/service/tag.rb

Instance Attribute Summary

Attributes inherited from BaseService

#client

Instance Method Summary collapse

Methods included from ApiOperations::Find

#find

Methods included from ApiOperations::Delete

#delete

Methods included from ApiOperations::FindAll

#find_all

Methods included from ApiOperations::List

#all

Methods included from ApiOperations::Save

#create, #identity_hash, #save

Methods inherited from BaseService

#collection_name, #from_api, #initialize

Constructor Details

This class inherits a constructor from Intercom::Service::BaseService

Instance Method Details

#collection_classObject



16
17
18
# File 'lib/intercom/service/tag.rb', line 16

def collection_class
  Intercom::Tag
end

#collection_proxy_classObject



20
21
22
# File 'lib/intercom/service/tag.rb', line 20

def collection_proxy_class
  Intercom::BaseCollectionProxy
end

#tag(params) ⇒ Object



24
25
26
27
# File 'lib/intercom/service/tag.rb', line 24

def tag(params)
  params['tag_or_untag'] = 'tag'
  create(params)
end

#untag(params) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/intercom/service/tag.rb', line 29

def untag(params)
  params['tag_or_untag'] = 'untag'
  params[:companies].each do |company|
    company[:untag] = true
  end
  create(params)
end