Sha256: 8d713b11b2f00ea84d01155a732b293edec93fa78afaac5938cf15b11a6bd03e

Contents?: true

Size: 461 Bytes

Versions: 16

Compression:

Stored size: 461 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
    protected
    def untag_id!(tag_id)
      self.delete("tags/#{tag_id}")
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
highrise-3.1.5 lib/highrise/taggable.rb
highrise-3.1.2 lib/highrise/taggable.rb
highrise-3.1.1 lib/highrise/taggable.rb
highrise-3.1.0 lib/highrise/taggable.rb
highrise-3.1.0.pre lib/highrise/taggable.rb
highrise-3.0.5 lib/highrise/taggable.rb
highrise-3.0.4 lib/highrise/taggable.rb
highrise-3.0.3 lib/highrise/taggable.rb
peterosullivan-highrise-3.0.7 lib/highrise/taggable.rb
peterosullivan-highrise-3.0.6 lib/highrise/taggable.rb
peterosullivan-highrise-3.0.5 lib/highrise/taggable.rb
peterosullivan-highrise-3.0.4 lib/highrise/taggable.rb
peterosullivan-highrise-3.0.3 lib/highrise/taggable.rb
peterosullivan-highrise-3.0.2 lib/highrise/taggable.rb
highrise-3.0.1 lib/highrise/taggable.rb
highrise-3.0.0 lib/highrise/taggable.rb