module CucumberFM::FeatureElement::Component::Tags

Constants

LINE_PATTERN
PATTERN
STATUS_COMPLETE
TAG_PATTERN
TECHNICAL

Public Instance Methods

done?() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 51
def done?
  STATUS_COMPLETE.include?(status)
end
estimation() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 56
def estimation
  effort ? effort.gsub('@', '').to_f : 0.0
end
tags() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 39
def tags
  @tags ||= fetch_tags
end
tags=(tags) click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 43
def tags= tags
  @tags = tags
end
tags_without_technical() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 47
def tags_without_technical
  tags - TECHNICAL
end
value() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 60
def value
  benefit ? benefit.gsub('@_', '').to_i : 0
end

Private Instance Methods

detect_type(tag) click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 92
def detect_type tag
  PATTERN.invert.each_pair do |pattern, type|
    return(type) if tag =~ pattern
  end
end
fetch_tags() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 66
def fetch_tags
  this_tags + parent_tags_without_duplicates
end
find(type, collection = tags) click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 86
def find type, collection = tags
  collection.detect do |tag|
    !TECHNICAL.include?(tag) and tag =~ PATTERN[type]
  end
end
method_missing(m, *args, &block) click to toggle source
Calls superclass method
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 98
def method_missing(m, *args, &block)
  if PATTERN.has_key?(m.to_sym)
    find(m.to_sym)
  else
    super
  end
end
parent_tags() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 78
def parent_tags
  respond_to?(:second_tags_source) ? second_tags_source.tags : []
end
parent_tags_without_duplicates() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 82
def parent_tags_without_duplicates
   parent_tags.collect { |p_tag| (type = detect_type(p_tag) and find(type, this_tags)) ? nil : p_tag }.compact
end
this_tags() click to toggle source
# File lib/cucumber_f_m/feature_element/component/tags.rb, line 70
def this_tags
  if tag_line = LINE_PATTERN.match(raw)
    tag_line[0].scan(TAG_PATTERN)
  else
    []
  end
end