Class: Primalize::Single::Number

Inherits:
Object
  • Object
show all
Includes:
Type
Defined in:
lib/primalize/single.rb

Constant Summary

Constants included from Type

Type::DEFAULT_COERCION

Instance Method Summary collapse

Methods included from Type

#coerce

Constructor Details

#initialize(&coercion) ⇒ Number

Returns a new instance of Number.



197
198
199
# File 'lib/primalize/single.rb', line 197

def initialize &coercion
  @coercion = coercion
end

Instance Method Details

#===(value) ⇒ Object



201
202
203
# File 'lib/primalize/single.rb', line 201

def === value
  ::Numeric === value
end

#inspectObject



205
206
207
# File 'lib/primalize/single.rb', line 205

def inspect
  'number'
end