Class: AACMetrics::Metrics::ExtraFloat
- Inherits:
-
Numeric
- Object
- Numeric
- AACMetrics::Metrics::ExtraFloat
- Includes:
- Math
- Defined in:
- lib/aac-metrics/metrics.rb
Instance Method Summary collapse
-
#initialize(float = 0.0) ⇒ ExtraFloat
constructor
A new instance of ExtraFloat.
- #method_missing(message, *args, &block) ⇒ Object
- #to_f ⇒ Object
Constructor Details
#initialize(float = 0.0) ⇒ ExtraFloat
Returns a new instance of ExtraFloat.
395 396 397 |
# File 'lib/aac-metrics/metrics.rb', line 395 def initialize(float=0.0) @float = Float(float) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(message, *args, &block) ⇒ Object
403 404 405 406 407 408 409 |
# File 'lib/aac-metrics/metrics.rb', line 403 def method_missing(, *args, &block) if block_given? @float.public_send(, *args, &block) else @float.public_send(, *args) end end |
Instance Method Details
#to_f ⇒ Object
399 400 401 |
# File 'lib/aac-metrics/metrics.rb', line 399 def to_f @float.to_f end |