Class: Percentage
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Percentage
constructor
A new instance of Percentage.
- #method_missing(*args, &block) ⇒ Object
- #to_f ⇒ Object
Constructor Details
#initialize(value) ⇒ Percentage
Returns a new instance of Percentage.
12 13 14 |
# File 'lib/glimr/util.rb', line 12 def initialize(value) @value = value end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
20 21 22 23 24 |
# File 'lib/glimr/util.rb', line 20 def method_missing(*args, &block) to_f.__send__(*args, &block) rescue => e raise e end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/glimr/util.rb', line 10 def value @value end |
Instance Method Details
#to_f ⇒ Object
16 17 18 |
# File 'lib/glimr/util.rb', line 16 def to_f value / 100.0 end |