Class: CoercedPercent
- Inherits:
-
Struct
- Object
- Struct
- CoercedPercent
- Defined in:
- lib/percentable/coerced_percent.rb
Instance Attribute Summary collapse
-
#percent ⇒ Object
Returns the value of attribute percent.
Instance Method Summary collapse
Instance Attribute Details
#percent ⇒ Object
Returns the value of attribute percent
1 2 3 |
# File 'lib/percentable/coerced_percent.rb', line 1 def percent @percent end |
Instance Method Details
#*(other) ⇒ Object
10 11 12 |
# File 'lib/percentable/coerced_percent.rb', line 10 def * other other * percent.to_f end |
#+(other) ⇒ Object
2 3 4 |
# File 'lib/percentable/coerced_percent.rb', line 2 def + other other + self * other end |
#-(other) ⇒ Object
6 7 8 |
# File 'lib/percentable/coerced_percent.rb', line 6 def - other other - self * other end |
#/(other) ⇒ Object
14 15 16 |
# File 'lib/percentable/coerced_percent.rb', line 14 def / other other / percent.to_f end |