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”)
9 10 11 12 13 14 15 16 |
# File 'lib/objective/errors/error_atom.rb', line 9 def initialize(key, codes, = {}) @key = key # attribute @codes = codes = [: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.
5 6 7 |
# File 'lib/objective/errors/error_atom.rb', line 5 def bound @bound end |
#codes ⇒ Object (readonly)
Returns the value of attribute codes.
5 6 7 |
# File 'lib/objective/errors/error_atom.rb', line 5 def codes @codes end |
#datum ⇒ Object (readonly)
Returns the value of attribute datum.
5 6 7 |
# File 'lib/objective/errors/error_atom.rb', line 5 def datum @datum end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/objective/errors/error_atom.rb', line 5 def key @key end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/objective/errors/error_atom.rb', line 5 def type @type end |
Instance Method Details
#message(parent_key = nil, index = nil) ⇒ Object
18 19 20 |
# File 'lib/objective/errors/error_atom.rb', line 18 def (parent_key = nil, index = nil) ||= Objective..(self, parent_key, index) end |
#message_list(parent_key = nil, index = nil) ⇒ Object
22 23 24 |
# File 'lib/objective/errors/error_atom.rb', line 22 def (parent_key = nil, index = nil) Array.wrap((parent_key, index)) end |