Class: Intercom::Service::Tag

Inherits:
BaseService show all
Includes:
ApiOperations::Delete, 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::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_proxy_class, #from_api, #initialize

Constructor Details

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

Instance Method Details

#collection_classObject


14
15
16
# File 'lib/intercom/service/tag.rb', line 14

def collection_class
  Intercom::Tag
end

#tag(params) ⇒ Object


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

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

#untag(params) ⇒ Object


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

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