Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/linmeric/CnGal_new_classes.rb
Overview
Overload of Numeric class
- Author
-
Massimiliano Dal Mas ([email protected])
- License
-
Distributed under MIT license
Instance Method Summary collapse
-
#can_divide?(obj) ⇒ Boolean
Checks if the numeric value can be divided by a given object.
-
#can_multiply?(obj) ⇒ Boolean
Checks if the numeric value can be multiplied by a given object.
-
#is_similar?(obj) ⇒ Boolean
Compares the value with another object.
Instance Method Details
#can_divide?(obj) ⇒ Boolean
Checks if the numeric value can be divided by a given object
-
argument: object for the checking
-
returns:
trueif the object is ‘Numeric` or Matrix;falseelse.
34 35 36 |
# File 'lib/linmeric/CnGal_new_classes.rb', line 34 def can_divide?(obj) (obj.is_a? Numeric) ? (return true) : ((obj.is_a? Matrix) ? (return true) : (return false)) end |
#can_multiply?(obj) ⇒ Boolean
Checks if the numeric value can be multiplied by a given object
-
argument: object for the checking
-
returns:
trueif the object is ‘Numeric` or Matrix;falseelse.
26 27 28 |
# File 'lib/linmeric/CnGal_new_classes.rb', line 26 def can_multiply?(obj) (obj.is_a? Numeric) ? (return true) : ((obj.is_a? Matrix) ? (return true) : (return false)) end |
#is_similar?(obj) ⇒ Boolean
Compares the value with another object
-
argument: object for the comparison
-
returns:
trueif the object is a ‘Numeric`;falseelse.
18 19 20 |
# File 'lib/linmeric/CnGal_new_classes.rb', line 18 def is_similar?(obj) (obj.is_a? Numeric) ? (return true) : (return false) end |