Class: Wood::Types::CompoundType
- Inherits:
-
Object
- Object
- Wood::Types::CompoundType
- Includes:
- TypeMatching
- Defined in:
- lib/wood/types.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #builtin? ⇒ Boolean
-
#initialize(type) ⇒ CompoundType
constructor
A new instance of CompoundType.
- #numeric? ⇒ Boolean
- #zero_value ⇒ Object
Methods included from TypeMatching
Constructor Details
#initialize(type) ⇒ CompoundType
Returns a new instance of CompoundType.
19 20 21 |
# File 'lib/wood/types.rb', line 19 def initialize(type) @type = type end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
18 19 20 |
# File 'lib/wood/types.rb', line 18 def type @type end |
Class Method Details
.[](type) ⇒ Object
14 15 16 |
# File 'lib/wood/types.rb', line 14 def self.[](type) new(type) end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/wood/types.rb', line 23 def == other case other when self.class return type == other.type else return false end end |
#builtin? ⇒ Boolean
36 37 38 |
# File 'lib/wood/types.rb', line 36 def builtin? type && type.builtin? end |
#numeric? ⇒ Boolean
32 33 34 |
# File 'lib/wood/types.rb', line 32 def numeric? false end |