Class: AACMetrics::Metrics::ExtraFloat

Inherits:
Numeric
  • Object
show all
Includes:
Math
Defined in:
lib/aac-metrics/metrics.rb

Instance Method Summary collapse

Constructor Details

#initialize(float = 0.0) ⇒ 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(message, *args, &block)
  if block_given?
    @float.public_send(message, *args, &block)
  else
    @float.public_send(message, *args)
  end
end

Instance Method Details

#to_fObject



399
400
401
# File 'lib/aac-metrics/metrics.rb', line 399

def to_f
  @float.to_f
end