Class: Ohm::Validations::Errors
Overview
A simple class for storing all errors. Since Errors extends Array, you can expect all array methods to work on it.
Instance Attribute Summary (collapse)
-
- (Object) model
Returns the value of attribute model.
Instance Method Summary (collapse)
-
- (Errors) initialize(model)
constructor
A new instance of Errors.
- - (Object) present(presenter = Presenter, &block)
Constructor Details
- (Errors) initialize(model)
A new instance of Errors
108 109 110 |
# File 'lib/ohm/validations.rb', line 108 def initialize(model) @model = model end |
Instance Attribute Details
- (Object) model
Returns the value of attribute model
106 107 108 |
# File 'lib/ohm/validations.rb', line 106 def model @model end |
Instance Method Details
- (Object) present(presenter = Presenter, &block)
112 113 114 |
# File 'lib/ohm/validations.rb', line 112 def present(presenter = Presenter, &block) presenter.new(model.errors).present(&block) end |