Class: Ohm::Validations::Errors

Inherits:
Array
  • Object
show all
Defined in:
lib/ohm/validations.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Errors) initialize(model)

A new instance of Errors



53
54
55
# File 'lib/ohm/validations.rb', line 53

def initialize(model)
  @model = model
end

Instance Attribute Details

- (Object) model

Returns the value of attribute model



51
52
53
# File 'lib/ohm/validations.rb', line 51

def model
  @model
end

Instance Method Details

- (Object) present(presenter = Presenter, &block)



57
58
59
# File 'lib/ohm/validations.rb', line 57

def present(presenter = Presenter, &block)
  presenter.new(model.errors).present(&block)
end