Class: Mona::Loaders::Base
- Inherits:
-
Object
- Object
- Mona::Loaders::Base
- Defined in:
- lib/mona/loaders/base.rb
Direct Known Subclasses
Defined Under Namespace
Modules: SetupDsl
Instance Attribute Summary collapse
-
#autoload_dirs ⇒ Object
readonly
Returns the value of attribute autoload_dirs.
-
#ignore_dirs ⇒ Object
readonly
Returns the value of attribute ignore_dirs.
-
#inflections ⇒ Object
readonly
Returns the value of attribute inflections.
-
#loader ⇒ Object
readonly
Returns the value of attribute loader.
-
#overwriters ⇒ Object
readonly
Returns the value of attribute overwriters.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Class Method Summary collapse
Instance Method Summary collapse
- #check_classes ⇒ Object
- #eager_load ⇒ Object
-
#initialize(root_path, &block) ⇒ Base
constructor
A new instance of Base.
- #push_dir(dir) ⇒ Object
- #reload ⇒ Object
- #setup ⇒ Object
Methods included from SetupDsl
Methods included from Mixins
Constructor Details
#initialize(root_path, &block) ⇒ Base
Returns a new instance of Base.
18 19 20 21 22 23 24 25 26 |
# File 'lib/mona/loaders/base.rb', line 18 def initialize(root_path, &block) @root_path = root_path @overwriters = [] @inflections = {} @ignore_dirs = [] @autoload_dirs = [] instance_exec(&block) if block_given? end |
Instance Attribute Details
#autoload_dirs ⇒ Object (readonly)
Returns the value of attribute autoload_dirs.
16 17 18 |
# File 'lib/mona/loaders/base.rb', line 16 def autoload_dirs @autoload_dirs end |
#ignore_dirs ⇒ Object (readonly)
Returns the value of attribute ignore_dirs.
16 17 18 |
# File 'lib/mona/loaders/base.rb', line 16 def ignore_dirs @ignore_dirs end |
#inflections ⇒ Object (readonly)
Returns the value of attribute inflections.
16 17 18 |
# File 'lib/mona/loaders/base.rb', line 16 def inflections @inflections end |
#loader ⇒ Object (readonly)
Returns the value of attribute loader.
16 17 18 |
# File 'lib/mona/loaders/base.rb', line 16 def loader @loader end |
#overwriters ⇒ Object (readonly)
Returns the value of attribute overwriters.
16 17 18 |
# File 'lib/mona/loaders/base.rb', line 16 def overwriters @overwriters end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
16 17 18 |
# File 'lib/mona/loaders/base.rb', line 16 def root_path @root_path end |
Class Method Details
.inherited(subclass) ⇒ Object
9 10 11 12 13 |
# File 'lib/mona/loaders/base.rb', line 9 def inherited(subclass) name = subclass.to_s.split("::").last.downcase.to_sym registry[name] = subclass end |
.registry ⇒ Object
5 6 7 |
# File 'lib/mona/loaders/base.rb', line 5 def registry @registry ||= {} end |
Instance Method Details
#check_classes ⇒ Object
44 45 46 |
# File 'lib/mona/loaders/base.rb', line 44 def check_classes raise StandardError.new('not implemented') end |
#eager_load ⇒ Object
40 41 42 |
# File 'lib/mona/loaders/base.rb', line 40 def eager_load raise StandardError.new('not implemented') end |
#push_dir(dir) ⇒ Object
28 29 30 |
# File 'lib/mona/loaders/base.rb', line 28 def push_dir(dir) @autoload_dirs.push(dir) end |
#reload ⇒ Object
36 37 38 |
# File 'lib/mona/loaders/base.rb', line 36 def reload raise StandardError.new('not implemented') end |
#setup ⇒ Object
32 33 34 |
# File 'lib/mona/loaders/base.rb', line 32 def setup raise StandardError.new('not implemented') end |