Exception: Curlybars::Error::Base

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

Direct Known Subclasses

Compile, Lex, Parse, Render, Validate

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, message, position, metadata = {}) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
11
12
13
14
15
# File 'lib/curlybars/error/base.rb', line 6

def initialize(id, message, position,  = {})
  super(message)
  @id = id
  @position = position
  @metadata = 
  return if position.nil?
  return if position.file_name.nil?
  location = "%s:%d:%d" % [position.file_name, position.line_number, position.line_offset]
  set_backtrace([location])
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/curlybars/error/base.rb', line 4

def id
  @id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



4
5
6
# File 'lib/curlybars/error/base.rb', line 4

def 
  @metadata
end

#positionObject (readonly)

Returns the value of attribute position.



4
5
6
# File 'lib/curlybars/error/base.rb', line 4

def position
  @position
end