Class: Hippo::Extensions::Definition

Inherits:
Object
  • Object
show all
Includes:
Concerns::AttrAccessorWithDefault
Defined in:
lib/hippo/extension/definition.rb

Direct Known Subclasses

Base

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDefinition

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

#contextObject (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_pathObject


60
61
62
63
64
65
# File 'lib/hippo/extension/definition.rb', line 60

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_configurationObject


67
68
69
70
71
72
# File 'lib/hippo/extension/definition.rb', line 67

def apply_configuration
     config_file = root_path.join('config', 'hippo.rb')
     if config_file.exist?
         require config_file
     end
end

#client_extension_pathObject


74
75
76
# File 'lib/hippo/extension/definition.rb', line 74

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_consoleObject


50
51
# File 'lib/hippo/extension/definition.rb', line 50

def on_dev_console
end

#route(route_set) ⇒ Object


53
54
55
56
57
58
# File 'lib/hippo/extension/definition.rb', line 53

def route(route_set)
    routes_config = root_path.join('config','routes.rb')
    if routes_config.exist?
        require routes_config
    end
end

#static_bootstrap_dataObject


42
43
44
# File 'lib/hippo/extension/definition.rb', line 42

def static_bootstrap_data
    {}
end

#tenant_bootstrap_data(tenant) ⇒ Object


46
47
48
# File 'lib/hippo/extension/definition.rb', line 46

def tenant_bootstrap_data(tenant)
    {}
end