module DTK::DSL::FileGenerator::ContentInput::Mixin

Mixin for tags and id_handle object attributes

Attributes

tags[R]

Public Instance Methods

add_tags!(new_tags) click to toggle source
# File lib/dsl/file_generator/content_input/mixin.rb, line 36
def add_tags!(new_tags)
  Tag.add_tags!(@tags, new_tags)
  self
end
add_tags?(new_tags) click to toggle source
# File lib/dsl/file_generator/content_input/mixin.rb, line 41
def add_tags?(new_tags)
  add_tags!(new_tags) unless new_tags.nil? or new_tags.empty?
end
add_tags_to_obj?(obj, new_tags) click to toggle source
# File lib/dsl/file_generator/content_input/mixin.rb, line 49
def add_tags_to_obj?(obj, new_tags) 
  obj.add_tags!(new_tags) if obj.respond_to?(:add_tags!)
  obj
end
id_handle() click to toggle source
# File lib/dsl/file_generator/content_input/mixin.rb, line 32
def id_handle
  @id_handle || raise(Error,"@id_handle is not set")
end
initialize_tags_and_id_handle!() click to toggle source
# File lib/dsl/file_generator/content_input/mixin.rb, line 23
def initialize_tags_and_id_handle!
  @tags      = []
  @id_handle = nil
end
matches_tag_type?(tag_type) click to toggle source
# File lib/dsl/file_generator/content_input/mixin.rb, line 45
def matches_tag_type?(tag_type)
  !! @tags.find { |tag| Tag.matches_tag_type?(tag_type, tag) }
end
obj_has_tag_type?(obj, tag_type) click to toggle source
# File lib/dsl/file_generator/content_input/mixin.rb, line 54
def obj_has_tag_type?(obj, tag_type)  
  if obj.respond_to?(:matches_tag_type?)
    obj.matches_tag_type?(tag_type)
  else
    # vacuously succeeds
    true
  end
end
set_id_handle(model_object) click to toggle source
# File lib/dsl/file_generator/content_input/mixin.rb, line 28
def set_id_handle(model_object)
  @id_handle = model_object.id_handle
end