Class: RubyRedtail::Contact::TagGroups

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-redtail/contact/tag_groups.rb

Instance Method Summary collapse

Constructor Details

#initialize(contact_id, api_hash) ⇒ TagGroups

Returns a new instance of TagGroups.



4
5
6
7
# File 'lib/ruby-redtail/contact/tag_groups.rb', line 4

def initialize(contact_id,api_hash)
  @api_hash = api_hash
  @contact_id = contact_id
end

Instance Method Details

#fetchObject

def fetch(tag_id)

RubyRedtail::Query.run("tag_groups/#{tag_id}", @api_hash, "GET")

end

def fetch_contacts(tag_id)

RubyRedtail::Query.run("tag_groups/#{tag_id}/contacts", @api_hash, "GET")

end



17
18
19
# File 'lib/ruby-redtail/contact/tag_groups.rb', line 17

def fetch
  build_tag_groups_array RubyRedtail::Query.run("contacts/#{@contact_id}/taggroups", @api_hash, "GET")["ArrayOfTagGroup"]
end