Class: Henshin::StandardPlugin

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

Direct Known Subclasses

Generator, LayoutParser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStandardPlugin

Defaults = {}



13
14
15
16
17
18
# File 'lib/henshin/plugin.rb', line 13

def initialize
  # inputs are the file types it will take
  # output should be the type it creates
  @extensions = {:input => [],
                 :output => ''}
end

Instance Attribute Details

#configObject

the main class for plugins to inherit from eg

class MyPlugin < NoName::StandardPlugin

or it can (and should) inherit a subclass from below



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

def config
  @config
end

#extensionsObject

the main class for plugins to inherit from eg

class MyPlugin < NoName::StandardPlugin

or it can (and should) inherit a subclass from below



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

def extensions
  @extensions
end

Instance Method Details

#<=>(other) ⇒ Object



32
33
34
# File 'lib/henshin/plugin.rb', line 32

def <=>(other)
  self.priority <=> other.priority
end

#configure(override) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/henshin/plugin.rb', line 20

def configure( override )
  if Defaults
    if override 
      @config = Defaults.merge(override) 
    else
      @config = Defaults
    end
  elsif override
    @config = override
  end
end