Module: CukeModeler::Taggable

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tagsObject

The models for tags which are directly assigned to the element



8
9
10
# File 'lib/cuke_modeler/taggable.rb', line 8

def tags
  @tags
end

Instance Method Details

#all_tagsObject

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



18
19
20
# File 'lib/cuke_modeler/taggable.rb', line 18

def all_tags
  applied_tags + @tags
end

#applied_tagsObject

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



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

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