Class: XDry::OGlobal

Inherits:
Object
  • Object
show all
Defined in:
lib/xdry/parsing/model.rb

Instance Method Summary collapse

Constructor Details

#initializeOGlobal

Returns a new instance of OGlobal.



6
7
8
# File 'lib/xdry/parsing/model.rb', line 6

def initialize
  @names_to_classes = {}
end

Instance Method Details

#<<(child) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/xdry/parsing/model.rb', line 18

def << child
  case child
  when SInterface
    lookup_class(child.class_name).add_interface child
  when SImplementation
    lookup_class(child.class_name).add_implementation child
  end
end

#classesObject



10
11
12
# File 'lib/xdry/parsing/model.rb', line 10

def classes
  @names_to_classes.values
end

#new_file_scopeObject



14
15
16
# File 'lib/xdry/parsing/model.rb', line 14

def new_file_scope
  SFile.new.bind(self)
end