Class: Puppet::Pops::Types::PFloatType

Inherits:
PNumericType show all
Defined in:
lib/puppet/pops/types/types.rb

Constant Summary collapse

DEFAULT =
PFloatType.new(-Float::INFINITY)

Instance Method Summary collapse

Methods inherited from PNumericType

#==, #from, #hash, #initialize, #numeric_from, #numeric_to, #to, #unbounded?

Methods inherited from PAnyType

#==, #assignable?, #callable?, #callable_args?, #enumerable?, #hash, #kind_of_callable?, #simple_name, #to_s

Methods included from Visitable

#accept

Constructor Details

This class inherits a constructor from Puppet::Pops::Types::PNumericType

Instance Method Details

#generalizeObject



542
543
544
# File 'lib/puppet/pops/types/types.rb', line 542

def generalize
  DEFAULT
end

#instance?(o) ⇒ Boolean

Returns:

  • (Boolean)


546
547
548
# File 'lib/puppet/pops/types/types.rb', line 546

def instance?(o)
  o.is_a?(Float) && o >= numeric_from && o <= numeric_to
end