Class: Numeric
- Defined in:
- lib/a_types/core_ext/boolean.rb,
lib/a_types/core_ext/numeric.rb
Overview
Numeric Additions.
Instance Method Summary collapse
-
#to_bool ⇒ true, false
(also: #to_b, #to_bool!, #to_b!)
Interprets this Numeric to a boolean value.
-
#to_num ⇒ Numeric
Returns itself.
Instance Method Details
#to_bool ⇒ true, false Also known as: to_b, to_bool!, to_b!
Interprets this Numeric to a boolean value.
12 13 14 |
# File 'lib/a_types/core_ext/boolean.rb', line 12 def to_bool self > 0 ? true : false end |
#to_num ⇒ Numeric
Returns itself.
18 19 20 |
# File 'lib/a_types/core_ext/numeric.rb', line 18 def to_num self end |