Class: ModelErrorMessages::Configuration
- Inherits:
-
Object
- Object
- ModelErrorMessages::Configuration
- Defined in:
- lib/model_error_messages/configuration.rb
Instance Attribute Summary collapse
-
#append_html ⇒ Object
Returns the value of attribute append_html.
-
#classes ⇒ Object
Returns the value of attribute classes.
-
#configuration ⇒ Object
writeonly
Sets the attribute configuration.
-
#prepend_html ⇒ Object
Returns the value of attribute prepend_html.
-
#single_error_in_paragraph ⇒ Object
Returns the value of attribute single_error_in_paragraph.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 |
# File 'lib/model_error_messages/configuration.rb', line 9 def initialize reset true end |
Instance Attribute Details
#append_html ⇒ Object
Returns the value of attribute append_html.
5 6 7 |
# File 'lib/model_error_messages/configuration.rb', line 5 def append_html @append_html end |
#classes ⇒ Object
Returns the value of attribute classes.
6 7 8 |
# File 'lib/model_error_messages/configuration.rb', line 6 def classes @classes end |
#configuration=(value) ⇒ Object (writeonly)
Sets the attribute configuration
7 8 9 |
# File 'lib/model_error_messages/configuration.rb', line 7 def configuration=(value) @configuration = value end |
#prepend_html ⇒ Object
Returns the value of attribute prepend_html.
4 5 6 |
# File 'lib/model_error_messages/configuration.rb', line 4 def prepend_html @prepend_html end |
#single_error_in_paragraph ⇒ Object
Returns the value of attribute single_error_in_paragraph.
3 4 5 |
# File 'lib/model_error_messages/configuration.rb', line 3 def single_error_in_paragraph @single_error_in_paragraph end |
Instance Method Details
#reset ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/model_error_messages/configuration.rb', line 14 def reset @single_error_in_paragraph = true @prepend_html = '' @append_html = '' @classes = lambda do |model| [ 'alert', 'alert-danger', model.class.model_name.param_key + '-error-messages' ].join(' ') end end |