Class: IDL::AST::Include
- Defined in:
- lib/ridl/node.rb,
lib/ridl/node.rb
Overview
TemplateModuleReference
Constant Summary
Constants inherited from Module
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#fullpath ⇒ Object
readonly
Returns the value of attribute fullpath.
Attributes inherited from Module
#anchor, #next, #template, #template_params
Attributes inherited from Leaf
#annotations, #enclosure, #intern, #name, #prefix, #scopes
Instance Method Summary collapse
-
#initialize(_name, _enclosure, params) ⇒ Include
constructor
A new instance of Include.
- #introduce(node) ⇒ Object
- #is_defined? ⇒ Boolean
- #is_preprocessed? ⇒ Boolean
- #lm_scopes ⇒ Object
- #marshal_dump ⇒ Object
- #marshal_load(vars) ⇒ Object
- #resolve(_name) ⇒ Object
- #undo_introduction(node) ⇒ Object
Methods inherited from Module
#annotations, #has_anchor?, #instantiate, #is_templated?, #redefine, #replace_prefix, #template_param
Methods inherited from Node
#define, #is_definable?, #match_members, #redefine, #replace_prefix, #select_members, #walk_members
Methods inherited from Leaf
#has_annotations?, #instantiate, #is_local?, #is_template?, #lm_name, #replace_prefix, #repository_id, #scoped_lm_name, #scoped_name, #set_repo_id, #set_repo_version, #typename, #unescaped_name
Constructor Details
#initialize(_name, _enclosure, params) ⇒ Include
Returns a new instance of Include.
833 834 835 836 837 838 839 840 841 842 |
# File 'lib/ridl/node.rb', line 833 def initialize(_name, _enclosure, params) super(_name, _enclosure, params) @filename = params[:filename] @fullpath = params[:fullpath] @defined = params[:defined] || false @preprocessed = params[:preprocessed] || false # overrule @scopes = @enclosure.scopes @scoped_name = @scopes.collect { |s| s.name }.join("::") end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
831 832 833 |
# File 'lib/ridl/node.rb', line 831 def filename @filename end |
#fullpath ⇒ Object (readonly)
Returns the value of attribute fullpath.
831 832 833 |
# File 'lib/ridl/node.rb', line 831 def fullpath @fullpath end |
Instance Method Details
#introduce(node) ⇒ Object
870 871 872 |
# File 'lib/ridl/node.rb', line 870 def introduce(node) @enclosure.introduce(node) unless node == self end |
#is_defined? ⇒ Boolean
862 863 864 |
# File 'lib/ridl/node.rb', line 862 def is_defined? @defined end |
#is_preprocessed? ⇒ Boolean
866 867 868 |
# File 'lib/ridl/node.rb', line 866 def is_preprocessed? @preprocessed end |
#lm_scopes ⇒ Object
844 845 846 |
# File 'lib/ridl/node.rb', line 844 def lm_scopes @lm_scopes ||= @enclosure.lm_scopes end |
#marshal_dump ⇒ Object
848 849 850 |
# File 'lib/ridl/node.rb', line 848 def marshal_dump super() << @filename << @defined << @preprocessed end |
#marshal_load(vars) ⇒ Object
852 853 854 855 856 857 858 859 860 |
# File 'lib/ridl/node.rb', line 852 def marshal_load(vars) @preprocessed = vars.pop @defined = vars.pop @filename = vars.pop super(vars) # overrule @scopes = @enclosure.scopes || [] @scoped_name = @scopes.collect { |s| s.name }.join("::") end |
#resolve(_name) ⇒ Object
878 879 880 |
# File 'lib/ridl/node.rb', line 878 def resolve(_name) @enclosure.resolve(_name) end |
#undo_introduction(node) ⇒ Object
874 875 876 |
# File 'lib/ridl/node.rb', line 874 def undo_introduction(node) @enclosure.undo_introduction(node) unless node == self end |