Module: RedisTags::ClassMethods

Defined in:
lib/redis_tags.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_taggable_on_steroids_legacy_mode?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/redis_tags.rb', line 32

def acts_as_taggable_on_steroids_legacy_mode?
  @@acts_as_taggable_on_steroids_legacy == true
end

#has_tags(options = {}) ⇒ Object



40
41
42
# File 'lib/redis_tags.rb', line 40

def has_tags(options = {})
  RedisTags::RedisTag.has_tags(self, options)
end

#redis_tags_engineObject



36
37
38
# File 'lib/redis_tags.rb', line 36

def redis_tags_engine
  @@redis_tags_engine
end

#redis_tags_engine=(redis_instance) ⇒ Object



28
29
30
# File 'lib/redis_tags.rb', line 28

def redis_tags_engine=(redis_instance)
  @@redis_tags_engine = redis_instance
end

#tags_starting_with(partial_tag_name) ⇒ Object



44
45
46
# File 'lib/redis_tags.rb', line 44

def tags_starting_with(partial_tag_name)
  RedisTags::RedisTag.starts_with?(self.redis_tags_engine, partial_tag_name)
end

#uses_redis_tags(options = {}) ⇒ Object



22
23
24
25
26
# File 'lib/redis_tags.rb', line 22

def uses_redis_tags(options = {})
  options = {:engine => Redis.new, :acts_as_taggable_on_steroids_legacy_mode => false}.merge!(options)
  @@redis_tags_engine = options[:engine]
  @@acts_as_taggable_on_steroids_legacy = options[:acts_as_taggable_on_steroids_legacy_mode]
end