Class: FastRuby::TranslatorModules
- Includes:
- Singleton
- Defined in:
- lib/fastruby/translator/translator_modules.rb
Instance Attribute Summary collapse
-
#modls ⇒ Object
Returns the value of attribute modls.
Instance Method Summary collapse
- #each_under(dir) ⇒ Object
-
#initialize ⇒ TranslatorModules
constructor
A new instance of TranslatorModules.
- #load_under(dir) ⇒ Object
- #register_translator_module(modl) ⇒ Object
Constructor Details
#initialize ⇒ TranslatorModules
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
#modls ⇒ Object
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 |