Class: ActiveScaffold::DataStructures::ErrorMessage
- Defined in:
- lib/active_scaffold/data_structures/error_message.rb
Overview
Wrapper for error strings so that they may be exported using to_xxx
Instance Method Summary collapse
-
#initialize(error) ⇒ ErrorMessage
constructor
A new instance of ErrorMessage.
- #public_attributes ⇒ Object
- #to_s ⇒ Object
- #to_xml ⇒ Object
- #to_yaml ⇒ Object
Constructor Details
#initialize(error) ⇒ ErrorMessage
Returns a new instance of ErrorMessage.
4 5 6 |
# File 'lib/active_scaffold/data_structures/error_message.rb', line 4 def initialize(error) @error = error end |
Instance Method Details
#public_attributes ⇒ Object
8 9 10 |
# File 'lib/active_scaffold/data_structures/error_message.rb', line 8 def public_attributes { :error => @error } end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/active_scaffold/data_structures/error_message.rb', line 20 def to_s @error end |
#to_xml ⇒ Object
12 13 14 |
# File 'lib/active_scaffold/data_structures/error_message.rb', line 12 def to_xml public_attributes.to_xml(:root => "errors") end |
#to_yaml ⇒ Object
16 17 18 |
# File 'lib/active_scaffold/data_structures/error_message.rb', line 16 def to_yaml public_attributes.to_yaml end |