Class: Kangaroo::Util::Loader
- Inherits:
-
Object
- Object
- Kangaroo::Util::Loader
- Defined in:
- lib/kangaroo/util/loader.rb,
lib/kangaroo/util/loader/model.rb,
lib/kangaroo/util/loader/namespace.rb,
lib/kangaroo/util/loader/root_namespace.rb
Defined Under Namespace
Modules: Model, Namespace, RootNamespace
Instance Attribute Summary collapse
-
#database ⇒ Object
Returns the value of attribute database.
-
#model_names ⇒ Object
Returns the value of attribute model_names.
-
#models ⇒ Object
Returns the value of attribute models.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
Instance Method Summary collapse
-
#initialize(model_names, database, namespace = "Oo") ⇒ Loader
constructor
Initialize a Loader instance.
-
#load! ⇒ Array
Loads matching models and uses RubyAdapter to create the neccessary Ruby classes.
Constructor Details
#initialize(model_names, database, namespace = "Oo") ⇒ Loader
Initialize a Loader instance
15 16 17 18 19 20 |
# File 'lib/kangaroo/util/loader.rb', line 15 def initialize model_names, database, namespace = "Oo" @namespace = namespace[0,2] == "::" ? namespace : "::#{namespace}" @database = database @model_names = model_names sanitize_model_names end |
Instance Attribute Details
#database ⇒ Object
Returns the value of attribute database.
10 11 12 |
# File 'lib/kangaroo/util/loader.rb', line 10 def database @database end |
#model_names ⇒ Object
Returns the value of attribute model_names.
10 11 12 |
# File 'lib/kangaroo/util/loader.rb', line 10 def model_names @model_names end |
#models ⇒ Object
Returns the value of attribute models.
10 11 12 |
# File 'lib/kangaroo/util/loader.rb', line 10 def models @models end |
#namespace ⇒ Object
Returns the value of attribute namespace.
10 11 12 |
# File 'lib/kangaroo/util/loader.rb', line 10 def namespace @namespace end |
Instance Method Details
#load! ⇒ Array
Loads matching models and uses RubyAdapter to create the neccessary Ruby classes.
26 27 28 29 30 |
# File 'lib/kangaroo/util/loader.rb', line 26 def load! load_oo_models sort_oo_models adapt_oo_models end |