Class: Rubex::DataType::TypeDef
- Inherits:
-
Object
- Object
- Rubex::DataType::TypeDef
- Defined in:
- lib/rubex/data_type/type_def.rb
Overview
FIXME: Find out a better way to generically find the old type of a typedef
when the new type is encountered. Should cover cases where the new type
is aliased with some other name too. In other words, reach the actual
type in the most generic way possible without too many checks.
Instance Attribute Summary collapse
-
#new_type ⇒ Object
readonly
include Helpers.
-
#old_type ⇒ Object
readonly
include Helpers.
-
#type ⇒ Object
readonly
include Helpers.
Instance Method Summary collapse
- #alias_type? ⇒ Boolean
- #base_type ⇒ Object
-
#initialize(old_type, new_type, type) ⇒ TypeDef
constructor
A new instance of TypeDef.
- #method_missing(meth, *args, &block) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(old_type, new_type, type) ⇒ TypeDef
Returns a new instance of TypeDef.
11 12 13 14 15 |
# File 'lib/rubex/data_type/type_def.rb', line 11 def initialize(old_type, new_type, type) @old_type = old_type @new_type = new_type @type = type end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
29 30 31 |
# File 'lib/rubex/data_type/type_def.rb', line 29 def method_missing(meth, *args, &block) @old_type.send(meth, *args, &block) end |
Instance Attribute Details
#new_type ⇒ Object (readonly)
include Helpers
9 10 11 |
# File 'lib/rubex/data_type/type_def.rb', line 9 def new_type @new_type end |
#old_type ⇒ Object (readonly)
include Helpers
9 10 11 |
# File 'lib/rubex/data_type/type_def.rb', line 9 def old_type @old_type end |
#type ⇒ Object (readonly)
include Helpers
9 10 11 |
# File 'lib/rubex/data_type/type_def.rb', line 9 def type @type end |
Instance Method Details
#alias_type? ⇒ Boolean
17 18 19 |
# File 'lib/rubex/data_type/type_def.rb', line 17 def alias_type? true end |
#base_type ⇒ Object
25 26 27 |
# File 'lib/rubex/data_type/type_def.rb', line 25 def base_type @old_type end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/rubex/data_type/type_def.rb', line 21 def to_s @new_type.to_s end |