Class: Gherkin::Formatter::Model::Statement

Inherits:
Object
  • Object
show all
Defined in:
lib/gherkin/formatter/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(comments, tags, keyword, name, description, line) ⇒ Statement

Returns a new instance of Statement.



64
65
66
# File 'lib/gherkin/formatter/model.rb', line 64

def initialize(comments, tags, keyword, name, description, line)
  @comments, @tags, @keyword, @name, @description, @line = comments, tags, keyword, name, description, line
end

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



62
63
64
# File 'lib/gherkin/formatter/model.rb', line 62

def comments
  @comments
end

#descriptionObject (readonly)

Returns the value of attribute description.



62
63
64
# File 'lib/gherkin/formatter/model.rb', line 62

def description
  @description
end

#keywordObject (readonly)

Returns the value of attribute keyword.



62
63
64
# File 'lib/gherkin/formatter/model.rb', line 62

def keyword
  @keyword
end

#lineObject (readonly)

Returns the value of attribute line.



62
63
64
# File 'lib/gherkin/formatter/model.rb', line 62

def line
  @line
end

#nameObject (readonly)

Returns the value of attribute name.



62
63
64
# File 'lib/gherkin/formatter/model.rb', line 62

def name
  @name
end

#tagsObject (readonly)

Returns the value of attribute tags.



62
63
64
# File 'lib/gherkin/formatter/model.rb', line 62

def tags
  @tags
end

Instance Method Details

#line_rangeObject



68
69
70
71
# File 'lib/gherkin/formatter/model.rb', line 68

def line_range
  first = @comments[0] ? @comments[0].line : (@tags[0] ? @tags[0].line : line)
  first..line
end