Exception: Fortitude::Errors::NoContentAllowed

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(widget, tag) ⇒ NoContentAllowed

Returns a new instance of NoContentAllowed.



113
114
115
116
117
118
119
120
121
122
# File 'lib/fortitude/errors.rb', line 113

def initialize(widget, tag)
  message = %{The widget #{widget} tried to render an element, <#{tag.name}>, with content inside it, but that element doesn't accept content.}
  if tag.spec
    message << " (See '#{tag.spec}' for more details.)"
  end

  super(message)
  @widget = widget
  @tag = tag
end

Instance Attribute Details

#widgetObject (readonly)

Returns the value of attribute widget.



111
112
113
# File 'lib/fortitude/errors.rb', line 111

def widget
  @widget
end

Instance Method Details

#tag_nameObject



124
125
126
# File 'lib/fortitude/errors.rb', line 124

def tag_name
  @tag
end