Class: Objectifier::ErrorResult
- Inherits:
-
Hash
- Object
- Hash
- Objectifier::ErrorResult
- Defined in:
- lib/objectifier/result.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ErrorResult
constructor
A new instance of ErrorResult.
- #scope(name) ⇒ Object
- #success? ⇒ Boolean
- #value? ⇒ Boolean
Constructor Details
#initialize ⇒ ErrorResult
Returns a new instance of ErrorResult.
32 33 34 |
# File 'lib/objectifier/result.rb', line 32 def initialize super end |
Class Method Details
.err(name, value) ⇒ Object
36 37 38 39 40 |
# File 'lib/objectifier/result.rb', line 36 def self.err(name, value) new.tap do |x| x[name] = value end end |
Instance Method Details
#scope(name) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/objectifier/result.rb', line 42 def scope(name) reduce(self.class.new) do |h, kvp| k, v = kvp h[name.to_s+"."+k.to_s] = v h end end |
#success? ⇒ Boolean
50 51 52 |
# File 'lib/objectifier/result.rb', line 50 def success? false end |
#value? ⇒ Boolean
54 55 56 |
# File 'lib/objectifier/result.rb', line 54 def value? false end |