Class: Gherkin3::Token

Inherits:
Struct
  • Object
show all
Defined in:
lib/gherkin3/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



2
3
4
# File 'lib/gherkin3/token.rb', line 2

def line
  @line
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



2
3
4
# File 'lib/gherkin3/token.rb', line 2

def location
  @location
end

#matched_gherkin_dialectObject

Returns the value of attribute matched_gherkin_dialect.



3
4
5
# File 'lib/gherkin3/token.rb', line 3

def matched_gherkin_dialect
  @matched_gherkin_dialect
end

#matched_indentObject

Returns the value of attribute matched_indent.



3
4
5
# File 'lib/gherkin3/token.rb', line 3

def matched_indent
  @matched_indent
end

#matched_itemsObject

Returns the value of attribute matched_items.



3
4
5
# File 'lib/gherkin3/token.rb', line 3

def matched_items
  @matched_items
end

#matched_keywordObject

Returns the value of attribute matched_keyword.



3
4
5
# File 'lib/gherkin3/token.rb', line 3

def matched_keyword
  @matched_keyword
end

#matched_textObject

Returns the value of attribute matched_text.



3
4
5
# File 'lib/gherkin3/token.rb', line 3

def matched_text
  @matched_text
end

#matched_typeObject

Returns the value of attribute matched_type.



3
4
5
# File 'lib/gherkin3/token.rb', line 3

def matched_type
  @matched_type
end

Instance Method Details

#detachObject



10
11
12
# File 'lib/gherkin3/token.rb', line 10

def detach
  # TODO: detach line - is this needed?
end

#eof?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/gherkin3/token.rb', line 6

def eof?
  line.nil?
end

#token_valueObject



14
15
16
# File 'lib/gherkin3/token.rb', line 14

def token_value
  eof? ? "EOF" : line.get_line_text(-1)
end