Class: Objective::Errors::ErrorAtom
- Inherits:
-
Object
- Object
- Objective::Errors::ErrorAtom
- Defined in:
- lib/objective/errors/error_atom.rb
Instance Attribute Summary collapse
-
#bound ⇒ Object
readonly
Returns the value of attribute bound.
-
#codes ⇒ Object
readonly
Returns the value of attribute codes.
-
#datum ⇒ Object
readonly
Returns the value of attribute datum.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(key, codes, options = {}) ⇒ ErrorAtom
constructor
ErrorAtom.new(:name, :too_short) ErrorAtom.new(:name, :too_short, message: “is too short”).
- #message(parent_key = nil, index = nil) ⇒ Object
- #message_list(parent_key = nil, index = nil) ⇒ Object
Constructor Details
#initialize(key, codes, options = {}) ⇒ ErrorAtom
ErrorAtom.new(:name, :too_short) ErrorAtom.new(:name, :too_short, message: “is too short”)
10 11 12 13 14 15 16 17 |
# File 'lib/objective/errors/error_atom.rb', line 10 def initialize(key, codes, = {}) @key = key # attribute @codes = codes @message = [:message] @type = [:type] # target class/filter of coercion @value = [:value] # value given @bound = [:bound] # value of validator end |
Instance Attribute Details
#bound ⇒ Object (readonly)
Returns the value of attribute bound.
6 7 8 |
# File 'lib/objective/errors/error_atom.rb', line 6 def bound @bound end |
#codes ⇒ Object (readonly)
Returns the value of attribute codes.
6 7 8 |
# File 'lib/objective/errors/error_atom.rb', line 6 def codes @codes end |
#datum ⇒ Object (readonly)
Returns the value of attribute datum.
6 7 8 |
# File 'lib/objective/errors/error_atom.rb', line 6 def datum @datum end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/objective/errors/error_atom.rb', line 6 def key @key end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/objective/errors/error_atom.rb', line 6 def type @type end |
Instance Method Details
#message(parent_key = nil, index = nil) ⇒ Object
19 20 21 |
# File 'lib/objective/errors/error_atom.rb', line 19 def (parent_key = nil, index = nil) @message ||= Objective..(self, parent_key, index) end |