Class: Yamlint::Models::Token
- Inherits:
-
Object
- Object
- Yamlint::Models::Token
- Defined in:
- lib/yamlint/models/token.rb
Instance Attribute Summary collapse
-
#end_column ⇒ Object
readonly
Returns the value of attribute end_column.
-
#end_line ⇒ Object
readonly
Returns the value of attribute end_line.
-
#start_column ⇒ Object
readonly
Returns the value of attribute start_column.
-
#start_line ⇒ Object
readonly
Returns the value of attribute start_line.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type:, start_line:, start_column:, value: nil, end_line: nil, end_column: nil) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
Constructor Details
#initialize(type:, start_line:, start_column:, value: nil, end_line: nil, end_column: nil) ⇒ Token
Returns a new instance of Token.
8 9 10 11 12 13 14 15 |
# File 'lib/yamlint/models/token.rb', line 8 def initialize(type:, start_line:, start_column:, value: nil, end_line: nil, end_column: nil) @type = type @value = value @start_line = start_line @start_column = start_column @end_line = end_line || start_line @end_column = end_column || start_column end |
Instance Attribute Details
#end_column ⇒ Object (readonly)
Returns the value of attribute end_column.
6 7 8 |
# File 'lib/yamlint/models/token.rb', line 6 def end_column @end_column end |
#end_line ⇒ Object (readonly)
Returns the value of attribute end_line.
6 7 8 |
# File 'lib/yamlint/models/token.rb', line 6 def end_line @end_line end |
#start_column ⇒ Object (readonly)
Returns the value of attribute start_column.
6 7 8 |
# File 'lib/yamlint/models/token.rb', line 6 def start_column @start_column end |
#start_line ⇒ Object (readonly)
Returns the value of attribute start_line.
6 7 8 |
# File 'lib/yamlint/models/token.rb', line 6 def start_line @start_line end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/yamlint/models/token.rb', line 6 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/yamlint/models/token.rb', line 6 def value @value end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/yamlint/models/token.rb', line 17 def to_s "#{type}(#{start_line}:#{start_column})" end |