Class: Curlybars::Error::EOSPosition

Inherits:
Object
  • Object
show all
Defined in:
lib/curlybars/error/parse.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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

#lengthObject (readonly)

Returns the value of attribute length.



31
32
33
# File 'lib/curlybars/error/parse.rb', line 31

def length
  @length
end

#line_numberObject (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_offsetObject (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