Module: Pione::Util::BooleanValue
- Defined in:
- lib/pione/util/boolean-value.rb
Class Method Summary collapse
-
.of(val) ⇒ Boolean
Return boolean value of the object.
Class Method Details
.of(val) ⇒ Boolean
Return boolean value of the object.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/pione/util/boolean-value.rb', line 11 def of(val) case val when NilClass false when TrueClass true when FalseClass false when String of_string(val) when Numeric of_number(val) else raise ArgumentError.new(val) end end |