Class: Hippo::Extensions::Definition
- Inherits:
-
Object
- Object
- Hippo::Extensions::Definition
- Includes:
- Concerns::AttrAccessorWithDefault
- Defined in:
- lib/hippo/extension/definition.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Class Method Summary collapse
Instance Method Summary collapse
- #add_to_load_path ⇒ Object
- #apply_configuration ⇒ Object
- #client_bootstrap_data ⇒ Object
- #client_extension_path ⇒ Object
-
#initialize ⇒ Definition
constructor
A new instance of Definition.
- #load_after(extension) ⇒ Object
- #load_before(extension) ⇒ Object
- #on_dev_console ⇒ Object
- #route(route_set) ⇒ Object
Constructor Details
#initialize ⇒ Definition
Returns a new instance of Definition.
30 31 32 |
# File 'lib/hippo/extension/definition.rb', line 30 def initialize self.add_to_load_path end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
11 12 13 |
# File 'lib/hippo/extension/definition.rb', line 11 def context @context end |
Class Method Details
.inherited(klass) ⇒ Object
7 8 9 |
# File 'lib/hippo/extension/definition.rb', line 7 def self.inherited(klass) Extensions.add(klass) end |
Instance Method Details
#add_to_load_path ⇒ Object
56 57 58 59 60 61 |
# File 'lib/hippo/extension/definition.rb', line 56 def add_to_load_path @in_load_path_set ||= ( lib = root_path.join('lib').to_s $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) ) end |
#apply_configuration ⇒ Object
63 64 65 66 67 68 |
# File 'lib/hippo/extension/definition.rb', line 63 def apply_configuration config_file = root_path.join('config', 'hippo.rb') if config_file.exist? require config_file end end |
#client_bootstrap_data ⇒ Object
42 43 44 |
# File 'lib/hippo/extension/definition.rb', line 42 def client_bootstrap_data {} end |
#client_extension_path ⇒ Object
70 71 72 |
# File 'lib/hippo/extension/definition.rb', line 70 def client_extension_path "#{identifier}/extension" end |
#load_after(extension) ⇒ Object
34 35 36 |
# File 'lib/hippo/extension/definition.rb', line 34 def load_after(extension) self.after = extension end |
#load_before(extension) ⇒ Object
38 39 40 |
# File 'lib/hippo/extension/definition.rb', line 38 def load_before(extension) self.before = extension end |
#on_dev_console ⇒ Object
46 47 |
# File 'lib/hippo/extension/definition.rb', line 46 def on_dev_console end |
#route(route_set) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/hippo/extension/definition.rb', line 49 def route(route_set) routes_config = root_path.join('config','routes.rb') if routes_config.exist? require routes_config end end |