Class: Wood::Types::NumericType

Inherits:
BuiltinType show all
Defined in:
lib/wood/types.rb

Instance Attribute Summary

Attributes inherited from BuiltinType

#aliases, #name

Instance Method Summary collapse

Methods inherited from BuiltinType

#==, #builtin?, #node_name, #numeric?, #sexp, #type

Methods included from TypeMatching

included

Constructor Details

#initialize(name, *aliases) ⇒ NumericType

Returns a new instance of NumericType.



220
221
222
# File 'lib/wood/types.rb', line 220

def initialize(name, *aliases)
  super(name, true, *aliases)
end

Instance Method Details

#zero_valueObject



224
225
226
# File 'lib/wood/types.rb', line 224

def zero_value
  @zero_value ||= Wood::Nodes::Literal[type: self, value: 0]
end