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.
28 29 30 31 32 33 34 |
# File 'lib/oxidized/manager.rb', line 28 def initialize @input = {} @output = {} @source = {} @model = {} @hook = {} end |
Instance Attribute Details
#hook ⇒ Object (readonly)
Returns the value of attribute hook.
26 27 28 |
# File 'lib/oxidized/manager.rb', line 26 def hook @hook end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
26 27 28 |
# File 'lib/oxidized/manager.rb', line 26 def input @input end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
26 27 28 |
# File 'lib/oxidized/manager.rb', line 26 def model @model end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
26 27 28 |
# File 'lib/oxidized/manager.rb', line 26 def output @output end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
26 27 28 |
# File 'lib/oxidized/manager.rb', line 26 def source @source end |
Class Method Details
.load(dir, file, namespace) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/oxidized/manager.rb', line 8 def load(dir, file, namespace) require File.join dir, file + '.rb' # Search the object to load in namespace klass = namespace.constants.find { |const| const.to_s.casecmp(file).zero? } return false unless klass klass = namespace.const_get klass i = klass.new i.setup if i.respond_to? :setup { file => klass } rescue LoadError false end |
Instance Method Details
#add_hook(name) ⇒ Object
52 53 54 |
# File 'lib/oxidized/manager.rb', line 52 def add_hook(name) loader @hook, Config::HOOK_DIR, "hook", name, Object end |
#add_input(name) ⇒ Object
36 37 38 |
# File 'lib/oxidized/manager.rb', line 36 def add_input(name) loader @input, Config::INPUT_DIR, "input", name, Oxidized end |
#add_model(name) ⇒ Object
48 49 50 |
# File 'lib/oxidized/manager.rb', line 48 def add_model(name) loader @model, Config::MODEL_DIR, "model", name, Object end |
#add_output(name) ⇒ Object
40 41 42 |
# File 'lib/oxidized/manager.rb', line 40 def add_output(name) loader @output, Config::OUTPUT_DIR, "output", name, Oxidized::Output end |
#add_source(name) ⇒ Object
44 45 46 |
# File 'lib/oxidized/manager.rb', line 44 def add_source(name) loader @source, Config::SOURCE_DIR, "source", name, Oxidized::Source end |