Class: CucumberAnalytics::Tag

Inherits:
Object
  • Object
show all
Includes:
Nested, Raw, Sourceable
Defined in:
lib/cucumber_analytics/tag.rb

Overview

A class modeling a Tag.

Instance Attribute Summary collapse

Attributes included from Nested

#parent_element

Attributes included from Sourceable

#source_line

Attributes included from Raw

#raw_element

Instance Method Summary collapse

Methods included from Nested

#get_ancestor

Constructor Details

#initialize(source = nil) ⇒ Tag

Creates a new Tag object and, if source is provided, populates the object.



18
19
20
21
22
# File 'lib/cucumber_analytics/tag.rb', line 18

def initialize(source = nil)
  parsed_tag = process_source(source)

  build_tag(parsed_tag) if parsed_tag
end

Instance Attribute Details

#nameObject

The name of the Tag



13
14
15
# File 'lib/cucumber_analytics/tag.rb', line 13

def name
  @name
end

Instance Method Details

#to_sObject

Returns gherkin representation of the tag.



25
26
27
# File 'lib/cucumber_analytics/tag.rb', line 25

def to_s
  name || ''
end