Class: RubyRedtail::TagGroup
- Inherits:
-
Object
- Object
- RubyRedtail::TagGroup
- Defined in:
- lib/ruby-redtail/tag_group.rb
Instance Method Summary collapse
- #contacts ⇒ Object
-
#initialize(tag_group = {}, api_hash) ⇒ TagGroup
constructor
A new instance of TagGroup.
Constructor Details
#initialize(tag_group = {}, api_hash) ⇒ TagGroup
Returns a new instance of TagGroup.
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ruby-redtail/tag_group.rb', line 4 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
#contacts ⇒ Object
18 19 20 |
# File 'lib/ruby-redtail/tag_group.rb', line 18 def contacts build_contacts_array RubyRedtail::Query.run("taggroups/#{@id}/contacts", @api_hash, "GET")["TagMembers"] end |