Module: CukeModeler::Taggable Private

Included in:
Example, Feature, Outline, Rule, Scenario
Defined in:
lib/cuke_modeler/taggable.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

A mix-in module containing methods used by models that represent an element that can be tagged. Internal helper class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tagsObject

The models for tags which are directly assigned to the element



12
13
14
# File 'lib/cuke_modeler/taggable.rb', line 12

def tags
  @tags
end

Instance Method Details

#all_tagsArray<Tag>

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

Examples:

model.all_tags

Returns:

  • (Array<Tag>)

    All tag models



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

def all_tags
  applied_tags + @tags
end

#applied_tagsArray<Tag>

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

Examples:

model.applied_tags

Returns:

  • (Array<Tag>)

    Applied tag models



24
25
26
# File 'lib/cuke_modeler/taggable.rb', line 24

def applied_tags
  parent_model.respond_to?(:all_tags) ? parent_model.all_tags : []
end