Class: Objectifier::ErrorResult

Inherits:
Hash
  • Object
show all
Defined in:
lib/objectifier/result.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrorResult

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

Returns:

  • (Boolean)


50
51
52
# File 'lib/objectifier/result.rb', line 50

def success?
  false
end

#value?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/objectifier/result.rb', line 54

def value?
  false
end