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)
-
- (Object) element
readonly
Returns the value of attribute element.
-
- (Object) value
readonly
Returns the value of attribute value.
Instance Method Summary (collapse)
-
- (FormatError) initialize(element, value, message)
constructor
Takes an Element, the value, and a message.
- - (Object) to_s
Constructor Details
- (FormatError) initialize(element, value, message)
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."
273 274 275 276 277 278 |
# File 'lib/spiderfw/model/model.rb', line 273 def initialize(element, value, ) @element = element @message = @value = value super() end |
Instance Attribute Details
- (Object) element (readonly)
Returns the value of attribute element
267 268 269 |
# File 'lib/spiderfw/model/model.rb', line 267 def element @element end |
- (Object) value (readonly)
Returns the value of attribute value
267 268 269 |
# File 'lib/spiderfw/model/model.rb', line 267 def value @value end |
Instance Method Details
- (Object) to_s
281 282 283 284 285 286 |
# File 'lib/spiderfw/model/model.rb', line 281 def to_s label = @element.label Spider::GetText.in_domain('spider'){ _(@message) % label } end |