module CukeModeler::Taggable

NOT A PART OF THE PUBLIC API A mix-in module containing methods used by models that represent an element that can be tagged.

Attributes

tags[RW]

The models for tags which are directly assigned to the element

Public Instance Methods

all_tags() click to toggle source

Returns models for all of the tags which are applicable to the element.

# File lib/cuke_modeler/taggable.rb, line 18
def all_tags
  applied_tags + @tags
end
applied_tags() click to toggle source

Returns the models for tags which are indirectly assigned to the element (i.e. they have been inherited from a parent element).

# File lib/cuke_modeler/taggable.rb, line 13
def applied_tags
  parent_model.respond_to?(:all_tags) ? parent_model.all_tags : []
end

Private Instance Methods

populate_tags(model, parsed_model_data) click to toggle source
# File lib/cuke_modeler/taggable.rb, line 30
def populate_tags(model, parsed_model_data)
  return unless parsed_model_data['tags']

  parsed_model_data['tags'].each do |tag|
    model.tags << build_child_model(Tag, tag)
  end
end
tag_output_string() click to toggle source
# File lib/cuke_modeler/taggable.rb, line 26
def tag_output_string
  tags.map(&:name).join(' ')
end