Class: NoFlyList::TaggableRecord::TagSetup

Inherits:
Object
  • Object
show all
Defined in:
lib/no_fly_list/taggable_record/tag_setup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(taggable_klass, context, options = {}) ⇒ TagSetup

Returns a new instance of TagSetup.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 10

def initialize(taggable_klass, context, options = {})
  @taggable_klass = taggable_klass
  @context = context
  @transformer = options.fetch(:transformer, ApplicationTagTransformer)
  @polymorphic = options.fetch(:polymorphic, false)
  @restrict_to_existing = options.fetch(:restrict_to_existing, false)
  @limit = options.fetch(:limit, nil)
  @tag_class_name = determine_tag_class_name(taggable_klass, options)
  @tagging_class_name = determine_tagging_class_name(taggable_klass, options)
  @adapter = determine_adapter
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def adapter
  @adapter
end

#contextObject (readonly)

Returns the value of attribute context.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def context
  @context
end

#limitObject (readonly)

Returns the value of attribute limit.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def limit
  @limit
end

#polymorphicObject (readonly)

Returns the value of attribute polymorphic.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def polymorphic
  @polymorphic
end

#restrict_to_existingObject (readonly)

Returns the value of attribute restrict_to_existing.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def restrict_to_existing
  @restrict_to_existing
end

#tag_class_nameObject (readonly)

Returns the value of attribute tag_class_name.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def tag_class_name
  @tag_class_name
end

#taggable_klassObject (readonly)

Returns the value of attribute taggable_klass.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def taggable_klass
  @taggable_klass
end

#tagging_class_nameObject (readonly)

Returns the value of attribute tagging_class_name.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def tagging_class_name
  @tagging_class_name
end

#transformerObject (readonly)

Returns the value of attribute transformer.



6
7
8
# File 'lib/no_fly_list/taggable_record/tag_setup.rb', line 6

def transformer
  @transformer
end