Class: Imagine::Plugin

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#directoryObject

Returns the value of attribute directory.



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

def directory
  @directory
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#pathnameObject

Returns the value of attribute pathname.



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

def pathname
  @pathname
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Class Method Details

.register {|plugin = self.new| ... } ⇒ Object

Yields:

  • (plugin = self.new)


9
10
11
12
13
14
15
16
# File 'lib/imagine/plugin.rb', line 9

def self.register(&block)
  yield(plugin = self.new)

  raise "A plugin MUST have a name!: #{plugin.inspect}" if plugin.name.blank?

  # add the new plugin to the collection of registered plugins
  ::Imagine::Plugins.registered << plugin
end