Exception: Singly::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/singly/error.rb

Direct Known Subclasses

ApiError

Class Method Summary collapse

Class Method Details

.y_u_no?(msg) ⇒ Boolean

Racist closure for raising errors Usage:

unhappy = true
Singly.y_u_no?("happy") { unhappy }

> Singly::Error: y u no happy???

Returns:

  • (Boolean)

Raises:



9
10
11
# File 'lib/singly/error.rb', line 9

def y_u_no?(msg)
  raise Error.new("y u no #{msg}???") if yield
end