Exception: Utopia::Content::Processor::UnbalancedTagError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/utopia/content/processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scanner, start_position, current_tag, closing_tag) ⇒ UnbalancedTagError

Returns a new instance of UnbalancedTagError.



36
37
38
39
40
41
42
43
44
# File 'lib/utopia/content/processor.rb', line 36

def initialize(scanner, start_position, current_tag, closing_tag)
	@scanner = scanner
	@start_position = start_position
	@current_tag = current_tag
	@closing_tag = closing_tag
	
	@starting_line = Trenni::Parser.line_at_offset(@scanner.string, @start_position)
	@ending_line = Trenni::Parser.line_at_offset(@scanner.string, @scanner.pos)
end

Instance Attribute Details

#closing_tagObject (readonly)

Returns the value of attribute closing_tag.



49
50
51
# File 'lib/utopia/content/processor.rb', line 49

def closing_tag
  @closing_tag
end

#current_tagObject (readonly)

Returns the value of attribute current_tag.



48
49
50
# File 'lib/utopia/content/processor.rb', line 48

def current_tag
  @current_tag
end

#scannerObject (readonly)

Returns the value of attribute scanner.



46
47
48
# File 'lib/utopia/content/processor.rb', line 46

def scanner
  @scanner
end

#start_positionObject (readonly)

Returns the value of attribute start_position.



47
48
49
# File 'lib/utopia/content/processor.rb', line 47

def start_position
  @start_position
end

Instance Method Details

#to_sObject



51
52
53
54
# File 'lib/utopia/content/processor.rb', line 51

def to_s
	"Unbalanced Tag Error. " \
	"Line #{@starting_line[:line_number]}: #{@current_tag} has been closed by #{@closing_tag} on line #{@ending_line[:line_number]}!"
end