Module: Solid::Failure

Included in:
Output::Failure, Result::Failure
Defined in:
lib/solid/failure.rb

Instance Method Summary collapse

Instance Method Details

#failure?(type = nil) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/solid/failure.rb', line 9

def failure?(type = nil)
  type.nil? || type_checker.allow_failure?([type])
end

#success?(_type = nil) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/solid/failure.rb', line 5

def success?(_type = nil)
  false
end

#value_or {|value| ... } ⇒ Object

Yields:

  • (value)


13
14
15
# File 'lib/solid/failure.rb', line 13

def value_or
  yield(value)
end