Class: Curlybars::Error::EOSPosition
- Inherits:
-
Object
- Object
- Curlybars::Error::EOSPosition
- Defined in:
- lib/curlybars/error/parse.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#line_offset ⇒ Object
readonly
Returns the value of attribute line_offset.
Instance Method Summary collapse
-
#initialize(source) ⇒ EOSPosition
constructor
A new instance of EOSPosition.
Constructor Details
#initialize(source) ⇒ EOSPosition
Returns a new instance of EOSPosition.
33 34 35 36 37 38 |
# File 'lib/curlybars/error/parse.rb', line 33 def initialize(source) @line_number = source.count("\n") + 1 @line_offset = 0 @length = source.rpartition("\n").last.length @file_name = nil end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
31 32 33 |
# File 'lib/curlybars/error/parse.rb', line 31 def file_name @file_name end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
31 32 33 |
# File 'lib/curlybars/error/parse.rb', line 31 def length @length end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
31 32 33 |
# File 'lib/curlybars/error/parse.rb', line 31 def line_number @line_number end |
#line_offset ⇒ Object (readonly)
Returns the value of attribute line_offset.
31 32 33 |
# File 'lib/curlybars/error/parse.rb', line 31 def line_offset @line_offset end |