Module: CodeModels::ForeignAstExtensions

Included in:
CodeModelsAstNode
Defined in:
lib/codemodels/source_info.rb

Overview

Inside an host language snippet of other languages can be hosted For example Java code could contain in a string literal a sql statement  or an Html file can contain CSS or Javascript code. In those cases an AST is inserted inside the AST of the host language.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#foreign_containerObject

Returns the value of attribute foreign_container.



135
136
137
# File 'lib/codemodels/source_info.rb', line 135

def foreign_container
  @foreign_container
end

Instance Method Details

#addForeign_asts(foreign_ast) ⇒ Object



137
138
139
140
# File 'lib/codemodels/source_info.rb', line 137

def addForeign_asts(foreign_ast)
  foreign_asts << foreign_ast
  foreign_ast.foreign_container = self
end

#foreign_astsObject



142
143
144
145
# File 'lib/codemodels/source_info.rb', line 142

def foreign_asts
  @foreign_asts=[] unless @foreign_asts
  @foreign_asts
end