Class: RKit::Core::Loader::Dependency
- Inherits:
-
String
- Object
- String
- RKit::Core::Loader::Dependency
- Defined in:
- lib/r_kit/core/loader.rb
Instance Attribute Summary collapse
-
#_base ⇒ Object
Returns the value of attribute _base.
Instance Method Summary collapse
- #dependency! ⇒ Object
-
#initialize(base, str: "") ⇒ Dependency
constructor
A new instance of Dependency.
- #load! ⇒ Object
- #should_load? ⇒ Boolean
Constructor Details
#initialize(base, str: "") ⇒ Dependency
Returns a new instance of Dependency.
108 109 110 111 112 |
# File 'lib/r_kit/core/loader.rb', line 108 def initialize base, str: "" @_base = base super str.to_s end |
Instance Attribute Details
#_base ⇒ Object
Returns the value of attribute _base.
106 107 108 |
# File 'lib/r_kit/core/loader.rb', line 106 def _base @_base end |
Instance Method Details
#dependency! ⇒ Object
118 119 120 121 122 123 124 125 |
# File 'lib/r_kit/core/loader.rb', line 118 def dependency! warn %Q{ WARNING - RKit::#{ classify } was implicitly loaded, As a dependency for #{ _base }. You may want to load it explicitly. } RKit.const_get(classify).load end |
#load! ⇒ Object
127 128 129 |
# File 'lib/r_kit/core/loader.rb', line 127 def load! dependency! if should_load? end |
#should_load? ⇒ Boolean
114 115 116 |
# File 'lib/r_kit/core/loader.rb', line 114 def should_load? !RKit::Core::Loader.class_variable_get(:@@loaded).include? self end |