Module: ActiveModel::Error::Base

Included in:
ActiveModel::Error
Defined in:
lib/active_model/error/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



4
5
6
# File 'lib/active_model/error/base.rb', line 4

def attribute
  @attribute
end

#baseObject (readonly)

Returns the value of attribute base.



4
5
6
# File 'lib/active_model/error/base.rb', line 4

def base
  @base
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/active_model/error/base.rb', line 4

def value
  @value
end

Instance Method Details

#initialize(subject = nil, options = {}) ⇒ Object



6
7
8
9
10
# File 'lib/active_model/error/base.rb', line 6

def initialize(subject = nil, options = {})
  @base, @attribute, @value = options.values_at(:model, :attribute, :value)
  @attribute = attribute
  super(subject, options)
end