Class: Praxis::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/praxis/plugin.rb

Overview

one instance is created per use.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#applicationObject

Returns the value of attribute application.



6
7
8
# File 'lib/praxis/plugin.rb', line 6

def application
  @application
end

#blockObject

Returns the value of attribute block.



7
8
9
# File 'lib/praxis/plugin.rb', line 7

def block
  @block
end

#configObject

Returns the value of attribute config.



8
9
10
# File 'lib/praxis/plugin.rb', line 8

def config
  @config
end

#config_attributeObject

Returns the value of attribute config_attribute.



9
10
11
# File 'lib/praxis/plugin.rb', line 9

def config_attribute
  @config_attribute
end

Instance Method Details

#after(stage, &block) ⇒ Object



31
32
33
# File 'lib/praxis/plugin.rb', line 31

def after(stage,&block)
  application.bootloader.after(stage,&block)
end

#before(stage, &block) ⇒ Object



35
36
37
# File 'lib/praxis/plugin.rb', line 35

def before(stage,&block)
  application.bootloader.before(stage,&block)
end

#config_keyObject



15
16
# File 'lib/praxis/plugin.rb', line 15

def config_key
end

#load_config!Object



21
22
23
24
25
26
# File 'lib/praxis/plugin.rb', line 21

def load_config!
  return unless options.has_key?(:config_file)
  return {} unless (application.root + options[:config_file]).exist?

  YAML.load_file(application.root + options[:config_file])
end

#optionsObject



11
12
13
# File 'lib/praxis/plugin.rb', line 11

def options
  @options ||= {}
end

#prepare_config!(node) ⇒ Object



18
19
# File 'lib/praxis/plugin.rb', line 18

def prepare_config!(node)
end

#setup!Object



28
29
# File 'lib/praxis/plugin.rb', line 28

def setup!
end