Class: FastRuby::TranslatorModules

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/fastruby/translator/translator_modules.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTranslatorModules

Returns a new instance of TranslatorModules.



29
30
31
# File 'lib/fastruby/translator/translator_modules.rb', line 29

def initialize
  @modls = Array.new
end

Instance Attribute Details

#modlsObject

Returns the value of attribute modls.



27
28
29
# File 'lib/fastruby/translator/translator_modules.rb', line 27

def modls
  @modls
end

Instance Method Details

#each_under(dir) ⇒ Object



37
38
39
40
41
# File 'lib/fastruby/translator/translator_modules.rb', line 37

def each_under(dir)
  Dir.glob(dir + "/*.rb") do |x|
    yield x
  end
end

#load_under(dir) ⇒ Object



43
44
45
46
47
# File 'lib/fastruby/translator/translator_modules.rb', line 43

def load_under(dir)
  each_under(dir) do |path|
    require path
  end
end

#register_translator_module(modl) ⇒ Object



33
34
35
# File 'lib/fastruby/translator/translator_modules.rb', line 33

def register_translator_module(modl)
  @modls << modl  
end