Class: Error
- Inherits:
-
Object
- Object
- Error
- Defined in:
- lib/gherkin_language/error.rb
Overview
This value entity class represents a language error
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#context ⇒ Object
Returns the value of attribute context.
-
#from_y ⇒ Object
Returns the value of attribute from_y.
-
#issuetype ⇒ Object
Returns the value of attribute issuetype.
-
#message ⇒ Object
Returns the value of attribute message.
-
#replacements ⇒ Object
Returns the value of attribute replacements.
-
#rule ⇒ Object
Returns the value of attribute rule.
-
#to_y ⇒ Object
Returns the value of attribute to_y.
Instance Method Summary collapse
-
#initialize(category, context, issuetype, message, replacements, rule, from_y, to_y) ⇒ Error
constructor
A new instance of Error.
- #str(references) ⇒ Object
Constructor Details
#initialize(category, context, issuetype, message, replacements, rule, from_y, to_y) ⇒ Error
Returns a new instance of Error.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/gherkin_language/error.rb', line 19 def initialize(category, context, issuetype, , replacements, rule, from_y, to_y) @category = category @context = context @issuetype = issuetype @message = @replacements = replacements @rule = rule @from_y = from_y @to_y = to_y end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
17 18 19 |
# File 'lib/gherkin_language/error.rb', line 17 def category @category end |
#context ⇒ Object
Returns the value of attribute context.
17 18 19 |
# File 'lib/gherkin_language/error.rb', line 17 def context @context end |
#from_y ⇒ Object
Returns the value of attribute from_y.
17 18 19 |
# File 'lib/gherkin_language/error.rb', line 17 def from_y @from_y end |
#issuetype ⇒ Object
Returns the value of attribute issuetype.
17 18 19 |
# File 'lib/gherkin_language/error.rb', line 17 def issuetype @issuetype end |
#message ⇒ Object
Returns the value of attribute message.
17 18 19 |
# File 'lib/gherkin_language/error.rb', line 17 def @message end |
#replacements ⇒ Object
Returns the value of attribute replacements.
17 18 19 |
# File 'lib/gherkin_language/error.rb', line 17 def replacements @replacements end |
#rule ⇒ Object
Returns the value of attribute rule.
17 18 19 |
# File 'lib/gherkin_language/error.rb', line 17 def rule @rule end |
#to_y ⇒ Object
Returns the value of attribute to_y.
17 18 19 |
# File 'lib/gherkin_language/error.rb', line 17 def to_y @to_y end |
Instance Method Details
#str(references) ⇒ Object
30 31 32 33 |
# File 'lib/gherkin_language/error.rb', line 30 def str(references) (red("[#{@issuetype}] #{@rule}\n") + " #{@message}\n Context: #{@context}\n Replacements: #{@replacements}\n References: #{references * ', '}\n") end |