Class: RubyRedtail::TagGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-redtail/tag_group.rb,
lib/ruby-redtail/tag_group/contacts.rb

Defined Under Namespace

Classes: Contacts

Instance Method Summary collapse

Constructor Details

#initialize(tag_group = {}, api_hash) ⇒ TagGroup

Returns a new instance of TagGroup.

Raises:



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ruby-redtail/tag_group.rb', line 6

def initialize(tag_group = {},api_hash)
  @api_hash = api_hash
  
  raise ArgumentError unless tag_group['RecID']
  @id = tag_group['RecID']
  
  raise ArgumentError if tag_group.class != Hash
  tag_group.each do |key, value|
    key = key.underscore
    self.class.send :attr_accessor, key
    instance_variable_set "@#{key}", value
  end
end

Instance Method Details

#contactsObject



20
21
22
# File 'lib/ruby-redtail/tag_group.rb', line 20

def contacts
  RubyRedtail::TagGroup::Contacts.new self.api_hash
end