Class: RubyBreaker::TypeDefs::FusionType
- Defined in:
- lib/rubybreaker/type/type.rb
Overview
This class represents any object that has certain methods whose types are same as the given nominal type’s counterparts. Usage: nominal_type
Instance Attribute Summary collapse
-
#nom_type ⇒ Object
This accessor sets/gets the nominal type to which the method names are bound.
Attributes inherited from DuckType
Attributes inherited from Type
Instance Method Summary collapse
-
#initialize(nom_type, meth_names = [], *args) ⇒ FusionType
constructor
A new instance of FusionType.
-
#mod ⇒ Object
This method gets the actual module of the nominal type for this fusion type.
Methods inherited from DuckType
Methods inherited from Type
Constructor Details
#initialize(nom_type, meth_names = [], *args) ⇒ FusionType
Returns a new instance of FusionType.
140 141 142 143 |
# File 'lib/rubybreaker/type/type.rb', line 140 def initialize(nom_type,meth_names=[],*args) super(meth_names,*args) @nom_type = nom_type end |
Instance Attribute Details
#nom_type ⇒ Object
This accessor sets/gets the nominal type to which the method names are bound.
138 139 140 |
# File 'lib/rubybreaker/type/type.rb', line 138 def nom_type @nom_type end |
Instance Method Details
#mod ⇒ Object
This method gets the actual module of the nominal type for this fusion type. This is a shorthand for t1.nom_type.mod().
147 148 149 |
# File 'lib/rubybreaker/type/type.rb', line 147 def mod() return @nom_type.mod end |