Class: Oxidized::Manager
- Inherits:
-
Object
- Object
- Oxidized::Manager
- Defined in:
- lib/oxidized/manager.rb
Instance Attribute Summary collapse
-
#hook ⇒ Object
readonly
Returns the value of attribute hook.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
- #add_hook(name) ⇒ Object
- #add_input(name) ⇒ Object
- #add_model(name) ⇒ Object
- #add_output(name) ⇒ Object
- #add_source(name) ⇒ Object
-
#initialize ⇒ Manager
constructor
A new instance of Manager.
Constructor Details
#initialize ⇒ Manager
Returns a new instance of Manager.
27 28 29 30 31 32 33 |
# File 'lib/oxidized/manager.rb', line 27 def initialize @input = {} @output = {} @source = {} @model = {} @hook = {} end |
Instance Attribute Details
#hook ⇒ Object (readonly)
Returns the value of attribute hook.
25 26 27 |
# File 'lib/oxidized/manager.rb', line 25 def hook @hook end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
25 26 27 |
# File 'lib/oxidized/manager.rb', line 25 def input @input end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
25 26 27 |
# File 'lib/oxidized/manager.rb', line 25 def model @model end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
25 26 27 |
# File 'lib/oxidized/manager.rb', line 25 def output @output end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
25 26 27 |
# File 'lib/oxidized/manager.rb', line 25 def source @source end |
Class Method Details
.load(dir, file) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/oxidized/manager.rb', line 8 def load(dir, file) require File.join dir, file + '.rb' klass = nil [Oxidized, Object].each do |mod| klass = mod.constants.find { |const| const.to_s.casecmp(file).zero? } klass ||= mod.constants.find { |const| const.to_s.downcase == 'oxidized' + file.downcase } klass = mod.const_get klass if klass break if klass end i = klass.new i.setup if i.respond_to? :setup { file => klass } rescue LoadError false end |
Instance Method Details
#add_hook(name) ⇒ Object
51 52 53 |
# File 'lib/oxidized/manager.rb', line 51 def add_hook(name) loader @hook, Config::HOOK_DIR, "hook", name end |
#add_input(name) ⇒ Object
35 36 37 |
# File 'lib/oxidized/manager.rb', line 35 def add_input(name) loader @input, Config::INPUT_DIR, "input", name end |
#add_model(name) ⇒ Object
47 48 49 |
# File 'lib/oxidized/manager.rb', line 47 def add_model(name) loader @model, Config::MODEL_DIR, "model", name end |
#add_output(name) ⇒ Object
39 40 41 |
# File 'lib/oxidized/manager.rb', line 39 def add_output(name) loader @output, Config::OUTPUT_DIR, "output", name end |
#add_source(name) ⇒ Object
43 44 45 |
# File 'lib/oxidized/manager.rb', line 43 def add_source(name) loader @source, Config::SOURCE_DIR, "source", name end |