Class: SimpleGherkinCollection

Inherits:
Collection show all
Defined in:
lib/cuker/models/models_ready.rb

Direct Known Subclasses

Background, TaggedGherkinCollection

Instance Attribute Summary collapse

Attributes inherited from Collection

#items, #keyword

Attributes inherited from Item

#content

Instance Method Summary collapse

Methods inherited from Collection

#to_s

Methods inherited from Item

#to_s

Constructor Details

#initialize(content_str, keyword) ⇒ SimpleGherkinCollection



70
71
72
73
# File 'lib/cuker/models/models_ready.rb', line 70

def initialize content_str, keyword
  super content_str
  @title = parse_title content_str, keyword
end

Instance Attribute Details

#commentsObject

Returns the value of attribute comments.



68
69
70
# File 'lib/cuker/models/models_ready.rb', line 68

def comments
  @comments
end

#titleObject

Returns the value of attribute title.



68
69
70
# File 'lib/cuker/models/models_ready.rb', line 68

def title
  @title
end

Instance Method Details

#parse_title(content, keyword) ⇒ Object



75
76
77
78
79
# File 'lib/cuker/models/models_ready.rb', line 75

def parse_title content, keyword
  match = content[/^\s*#{keyword}(.*)$/, 1]
  warn "no matches for '#{keyword}' in '#{content}'" unless match
  match
end