Module: Lite::Validation::Validator::Result::Disputable::Navigable

Includes:
Hash
Included in:
Lite::Validation::Validator::Result::Disputed::Navigable, Valid::Navigable
Defined in:
lib/lite/validation/validator/result/disputable/navigable.rb

Instance Method Summary collapse

Methods included from Hash

#child

Instance Method Details



22
23
24
25
26
27
28
29
# File 'lib/lite/validation/validator/result/disputable/navigable.rb', line 22

def navigate(*path, &block)
  if path.empty?
    block.call(self)
  else
    key, *rest = path
    enter(key, *rest, &block)
  end
end

#success_at?(*path) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
20
# File 'lib/lite/validation/validator/result/disputable/navigable.rb', line 13

def success_at?(*path)
  if path.empty?
    success?
  else
    key, *rest = path
    child(key).success_at?(*rest)
  end
end