Class: Raw::Morpher

Inherits:
Object
  • Object
show all
Defined in:
lib/raw/compiler/filter/morph/standard.rb

Overview

The base morpher class. Morphers are triggered by a special ‘key’ attribute in the xml stream and transform the owner element. Typically used along with the MorphFilter.

Direct Known Subclasses

EachMorpher, StandardMorpher

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, attributes) ⇒ Morpher

Returns a new instance of Morpher.



26
27
28
29
30
31
# File 'lib/raw/compiler/filter/morph/standard.rb', line 26

def initialize(name, attributes)
  @key = self.class.key
  @name = name
  @attributes = attributes
  @value = @attributes[@key]
end

Instance Attribute Details

#attributesObject

The tag attributes.



15
16
17
# File 'lib/raw/compiler/filter/morph/standard.rb', line 15

def attributes
  @attributes
end

#keyObject

The key



19
20
21
# File 'lib/raw/compiler/filter/morph/standard.rb', line 19

def key
  @key
end

#nameObject

The name of the tag.



11
12
13
# File 'lib/raw/compiler/filter/morph/standard.rb', line 11

def name
  @name
end

#valueObject

The value of the key.



23
24
25
# File 'lib/raw/compiler/filter/morph/standard.rb', line 23

def value
  @value
end

Instance Method Details

#after_end(buffer) ⇒ Object



42
43
# File 'lib/raw/compiler/filter/morph/standard.rb', line 42

def after_end(buffer)
end

#after_start(buffer) ⇒ Object



36
37
# File 'lib/raw/compiler/filter/morph/standard.rb', line 36

def after_start(buffer)
end

#before_end(buffer) ⇒ Object



39
40
# File 'lib/raw/compiler/filter/morph/standard.rb', line 39

def before_end(buffer)
end

#before_start(buffer) ⇒ Object



33
34
# File 'lib/raw/compiler/filter/morph/standard.rb', line 33

def before_start(buffer)
end