Class: Raw::Morpher
- Inherits:
-
Object
- Object
- Raw::Morpher
- 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
Instance Attribute Summary collapse
-
#attributes ⇒ Object
The tag attributes.
-
#key ⇒ Object
The key.
-
#name ⇒ Object
The name of the tag.
-
#value ⇒ Object
The value of the key.
Instance Method Summary collapse
- #after_end(buffer) ⇒ Object
- #after_start(buffer) ⇒ Object
- #before_end(buffer) ⇒ Object
- #before_start(buffer) ⇒ Object
-
#initialize(name, attributes) ⇒ Morpher
constructor
A new instance of Morpher.
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
#attributes ⇒ Object
The tag attributes.
15 16 17 |
# File 'lib/raw/compiler/filter/morph/standard.rb', line 15 def attributes @attributes end |
#key ⇒ Object
The key
19 20 21 |
# File 'lib/raw/compiler/filter/morph/standard.rb', line 19 def key @key end |
#name ⇒ Object
The name of the tag.
11 12 13 |
# File 'lib/raw/compiler/filter/morph/standard.rb', line 11 def name @name end |
#value ⇒ Object
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 |