Class: Parametric::Top
- Inherits:
-
Object
- Object
- Parametric::Top
- Defined in:
- lib/parametric/context.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #add_error(key, msg) ⇒ Object
-
#initialize ⇒ Top
constructor
A new instance of Top.
Constructor Details
#initialize ⇒ Top
Returns a new instance of Top.
5 6 7 |
# File 'lib/parametric/context.rb', line 5 def initialize @errors = {} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/parametric/context.rb', line 3 def errors @errors end |
Instance Method Details
#add_error(key, msg) ⇒ Object
9 10 11 12 |
# File 'lib/parametric/context.rb', line 9 def add_error(key, msg) errors[key] ||= [] errors[key] << msg end |