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
Defined Under Namespace
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
14 15 16 17 18 19 |
# File 'lib/kangaroo/util/loader.rb', line 14 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.
9 10 11 |
# File 'lib/kangaroo/util/loader.rb', line 9 def database @database end |
#model_names ⇒ Object
Returns the value of attribute model_names.
9 10 11 |
# File 'lib/kangaroo/util/loader.rb', line 9 def model_names @model_names end |
#models ⇒ Object
Returns the value of attribute models.
9 10 11 |
# File 'lib/kangaroo/util/loader.rb', line 9 def models @models end |
#namespace ⇒ Object
Returns the value of attribute namespace.
9 10 11 |
# File 'lib/kangaroo/util/loader.rb', line 9 def namespace @namespace end |
Instance Method Details
#load! ⇒ Array
Loads matching models and uses RubyAdapter to create the neccessary Ruby classes.
25 26 27 28 29 |
# File 'lib/kangaroo/util/loader.rb', line 25 def load! load_oo_models sort_oo_models adapt_oo_models end |