Sha256: 9f68a58e4e443b90f11b7e545a118031f136bf8c4d943af16a234c0702ab50f5

Contents?: true

Size: 450 Bytes

Versions: 9

Compression:

Stored size: 450 Bytes

Contents

module Highrise
  module Taggable        
    def tags
      self.get(:tags)
    end
    def tag!(tag_name)
      self.post(:tags, :name => tag_name) unless tag_name.blank?
    end    
    def untag!(tag_name)
      to_delete = self.tags.find{|tag| tag['name'] == tag_name} unless tag_name.blank?
      self.untag_id!(to_delete['id']) unless to_delete.nil?
    end     
    def untag_id!(tag_id)
      self.delete("tags/#{tag_id}")
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
rogerio-augusto-highrise-2.0.4 lib/highrise/taggable.rb
rogerio-augusto-highrise-2.0.3 lib/highrise/taggable.rb
rogerio-augusto-highrise-2.0.2 lib/highrise/taggable.rb
highrise-2.0.1 lib/highrise/taggable.rb
highrise-2.0.0 lib/highrise/taggable.rb
highrise-1.2.0 lib/highrise/taggable.rb
highrise-1.0.4 lib/highrise/taggable.rb
highrise-1.0.3 lib/highrise/taggable.rb
highrise-1.0.2 lib/highrise/taggable.rb