Class: Cucumber::Core::Ast::Comment

Inherits:
Object
  • Object
show all
Includes:
HasLocation
Defined in:
lib/cucumber/core/ast/comment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HasLocation

#attributes, #comments, #file, #file_colon_line, #line, #match_locations?, #multiline_arg, #tags

Constructor Details

#initialize(location, value) ⇒ Comment

Returns a new instance of Comment.



12
13
14
15
# File 'lib/cucumber/core/ast/comment.rb', line 12

def initialize(location, value)
  @location = location
  @value = value
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



9
10
11
# File 'lib/cucumber/core/ast/comment.rb', line 9

def location
  @location
end

Instance Method Details

#inspectObject



21
22
23
# File 'lib/cucumber/core/ast/comment.rb', line 21

def inspect
  %{#<#{self.class} #{value} (#{location})}
end

#to_sObject



17
18
19
# File 'lib/cucumber/core/ast/comment.rb', line 17

def to_s
  value
end