Permalink
Browse files

Add parameter to specify op and update example

  • Loading branch information...
1 parent 1a2fcb5 commit efc6e19cb77f030dda1987b3dca47826ecdef266 @erskingardner erskingardner committed Apr 2, 2013
Showing with 16 additions and 1 deletion.
  1. +16 −1 lib/intercom/tag.rb
View
@@ -17,6 +17,14 @@ module Intercom
# tag.name = "Super Tag"
# tag.color = "red"
# tag.user_ids = ['abc123', 'def456']
+ # tag.tag_or_untag = "tag"
+ # tag.save
+ #
+ # Or update a tag and save it like this:
+ # tag = Intercom::Tag.find_by_name "Super Tag"
+ # tag.color = "green"
+ # tag.user_ids = ['abc123', 'def456']
+ # tag.tag_or_untag = "untag"
# tag.save
class Tag < UserResource
@@ -47,7 +55,7 @@ def self.create(params)
end
##
- # Saves a note on your application
+ # Saves a Tag on your application
def save
response = Intercom.post("/v1/tags", to_hash)
self.update_from_api_response(response)
@@ -77,5 +85,12 @@ def emails=(emails)
@attributes["emails"] = emails
end
+ ##
+ # A string to specify whether to tag or untag the specified users, can be left out if only creating a new tag.
+ def tag_or_untag=(tag_or_untag)
+ return unless ["tag", "untag"].include?(tag_or_untag)
+ @attributes["tag_or_untag"] = tag_or_untag
+ end
+
end
end

0 comments on commit efc6e19

Please sign in to comment.