Exception: Spider::Model::FormatError
- Inherits:
-
FormatError
- Object
- RuntimeError
- FormatError
- Spider::Model::FormatError
- Defined in:
- lib/spiderfw/model/model.rb
Overview
Error raised when data can’t be accepted.
Instance Attribute Summary collapse
- #element ⇒ Element readonly
- #value ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(element, value, message) ⇒ FormatError
constructor
Takes an Element, the value, and a message.
- #to_s ⇒ Object
Constructor Details
#initialize(element, value, message) ⇒ FormatError
Takes an Element, the value, and a message. The message should be a format specification; it will be %‘d with the value.
error = FormatError.new(my_element, 3, "Element value %s is wrong.")
error.to_s => "Element value 3 is wrong."
344 345 346 347 348 349 |
# File 'lib/spiderfw/model/model.rb', line 344 def initialize(element, value, ) @element = element = @value = value super() end |
Instance Attribute Details
#element ⇒ Element (readonly)
333 334 335 |
# File 'lib/spiderfw/model/model.rb', line 333 def element @element end |
#value ⇒ Object (readonly)
335 336 337 |
# File 'lib/spiderfw/model/model.rb', line 335 def value @value end |
Instance Method Details
#to_s ⇒ Object
352 353 354 355 356 357 |
# File 'lib/spiderfw/model/model.rb', line 352 def to_s label = @element.label Spider::GetText.in_domain('spider'){ _() % label } end |