Class: ErrorContainer

Inherits:
Object
  • Object
show all
Defined in:
app/my_lib/error_container.rb

Overview

See Also:

  • ActiveModel::Errors#add

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrorContainer

Returns a new instance of ErrorContainer.



6
7
8
# File 'app/my_lib/error_container.rb', line 6

def initialize
  @errors = ActiveModel::Errors.new(self)
end

Class Method Details

.human_attribute_name(attribute) ⇒ Object



16
17
18
# File 'app/my_lib/error_container.rb', line 16

def self.human_attribute_name(attribute, *)
  attribute.to_s.humanize
end

Instance Method Details

#errorObject



12
13
14
# File 'app/my_lib/error_container.rb', line 12

def error
  errors
end