Class: Soca::Plugin

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pusher) ⇒ Plugin

Returns a new instance of Plugin.



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

def initialize(pusher)
  @pusher = pusher
end

Instance Attribute Details

#pusherObject (readonly)

Returns the value of attribute pusher.



3
4
5
# File 'lib/soca/plugin.rb', line 3

def pusher
  @pusher
end

Class Method Details

.name(plugin_name) ⇒ Object



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

def self.name(plugin_name)
  @@plugins ||= {}
  @@plugins[plugin_name] = self
end

.pluginsObject



10
11
12
# File 'lib/soca/plugin.rb', line 10

def self.plugins
  @@plugins ||= {}
end

Instance Method Details

#app_dirObject



26
27
28
# File 'lib/soca/plugin.rb', line 26

def app_dir
  pusher.app_dir
end

#loggerObject



22
23
24
# File 'lib/soca/plugin.rb', line 22

def logger
  Soca.logger
end

#run(options = {}) ⇒ Object



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

def run(options = {})
  raise "you need to subclass plugin and provide your own logic, please"
end