module CucumberAnalytics::Taggable

A mix-in module containing methods used by elements that can be tagged.

Attributes

tag_elements[RW]

The tag elements belonging to the element

tags[RW]

The tags which are directly assigned to the element

Public Instance Methods

all_tag_elements() click to toggle source

Returns all of the tag elements which are applicable to the element.

# File lib/cucumber_analytics/taggable.rb, line 32
def all_tag_elements
  applied_tag_elements + @tag_elements
end
all_tags() click to toggle source

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

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

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

# File lib/cucumber_analytics/taggable.rb, line 22
def applied_tag_elements
  @parent_element.respond_to?(:all_tag_elements) ? @parent_element.all_tag_elements : []
end
applied_tags() click to toggle source

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

# File lib/cucumber_analytics/taggable.rb, line 16
def applied_tags
  @parent_element.respond_to?(:all_tags) ? @parent_element.all_tags : []
end

Private Instance Methods

populate_element_tags(parsed_element) click to toggle source
# File lib/cucumber_analytics/taggable.rb, line 40
def populate_element_tags(parsed_element)
  if parsed_element['tags']
    parsed_element['tags'].each do |tag|
      @tags << tag['name']
      @tag_elements << build_child_element(Tag, tag)
    end
  end
end
tag_output_string() click to toggle source
# File lib/cucumber_analytics/taggable.rb, line 49
def tag_output_string
  tag_elements.collect { |tag| tag.name }.join(' ')
end