Class: SmartCore::Schema::Result Private
- Inherits:
-
Object
- Object
- SmartCore::Schema::Result
- Defined in:
- lib/smart_core/schema/result.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #errors ⇒ Hash<String,Array<Symbol>> readonly
- #extra_keys ⇒ Set<String> readonly
- #source ⇒ Hash<String,Any> readonly
- #spread_keys ⇒ Set<String> readonly
Instance Method Summary collapse
- #failure? ⇒ Boolean
- #initialize(source, errors, extra_keys, spread_keys) ⇒ void constructor private
- #success? ⇒ Boolean
Constructor Details
#initialize(source, errors, extra_keys, spread_keys) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 43 44 45 |
# File 'lib/smart_core/schema/result.rb', line 40 def initialize(source, errors, extra_keys, spread_keys) @source = source @errors = errors @extra_keys = extra_keys @spread_keys = spread_keys end |
Instance Attribute Details
#errors ⇒ Hash<String,Array<Symbol>> (readonly)
17 18 19 |
# File 'lib/smart_core/schema/result.rb', line 17 def errors @errors end |
#extra_keys ⇒ Set<String> (readonly)
23 24 25 |
# File 'lib/smart_core/schema/result.rb', line 23 def extra_keys @extra_keys end |
#source ⇒ Hash<String,Any> (readonly)
11 12 13 |
# File 'lib/smart_core/schema/result.rb', line 11 def source @source end |
#spread_keys ⇒ Set<String> (readonly)
29 30 31 |
# File 'lib/smart_core/schema/result.rb', line 29 def spread_keys @spread_keys end |
Instance Method Details
#failure? ⇒ Boolean
59 60 61 |
# File 'lib/smart_core/schema/result.rb', line 59 def failure? errors.any? || extra_keys.any? end |
#success? ⇒ Boolean
51 52 53 |
# File 'lib/smart_core/schema/result.rb', line 51 def success? errors.empty? && extra_keys.empty? end |