Class: Delorean::SubNodeNested

Inherits:
BaseNode
  • Object
show all
Defined in:
lib/delorean/nodes.rb

Instance Method Summary collapse

Methods inherited from BaseNode

#def_class

Instance Method Details

#check(context) ⇒ Object



104
105
106
107
108
109
110
# File 'lib/delorean/nodes.rb', line 104

def check(context, *)
  module_names = mod.m.text_value.split('::')
  node_name = module_names.pop
  mname = module_names.join('::') if module_names.any?

  context.parse_define_node(n.text_value, node_name, mname)
end

#rewrite(context) ⇒ Object



112
113
114
115
116
117
118
119
120
121
# File 'lib/delorean/nodes.rb', line 112

def rewrite(context)
  module_names = mod.m.text_value.split('::')
  node_name = module_names.pop
  mname = module_names.join('::') if module_names.any?

  sname = context.super_name(node_name, mname)

  # A sub-node (derived node) is just a subclass.
  def_class(context, sname)
end