Exception: Fortitude::Errors::InvalidElementNesting

Inherits:
Base
  • Object
show all
Defined in:
lib/fortitude/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(widget, enclosing_tag, enclosed_tag) ⇒ InvalidElementNesting

Returns a new instance of InvalidElementNesting.



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fortitude/errors.rb', line 44

def initialize(widget, enclosing_tag, enclosed_tag)
  message = %{The widget #{widget} tried to render an element that is not allowed by element nesting rules: you can't put a <#{enclosed_tag.name}> inside a <#{enclosing_tag.name}>.}
  if enclosing_tag.spec
    message << " (See '#{enclosing_tag.spec}' for more details.)"
  end

  super(message)
  @widget = widget
  @enclosing_tag = enclosing_tag
  @enclosed_tag = enclosed_tag
end

Instance Attribute Details

#enclosed_element_nameObject (readonly)

Returns the value of attribute enclosed_element_name.



42
43
44
# File 'lib/fortitude/errors.rb', line 42

def enclosed_element_name
  @enclosed_element_name
end

#enclosing_element_nameObject (readonly)

Returns the value of attribute enclosing_element_name.



42
43
44
# File 'lib/fortitude/errors.rb', line 42

def enclosing_element_name
  @enclosing_element_name
end

#widgetObject (readonly)

Returns the value of attribute widget.



42
43
44
# File 'lib/fortitude/errors.rb', line 42

def widget
  @widget
end

Instance Method Details

#enclosed_tag_nameObject



60
61
62
# File 'lib/fortitude/errors.rb', line 60

def enclosed_tag_name
  @enclosed_tag.name
end

#enclosing_tag_nameObject



56
57
58
# File 'lib/fortitude/errors.rb', line 56

def enclosing_tag_name
  @enclosing_tag.name
end