Class: Fop::Nodes::Text
- Inherits:
-
Struct
- Object
- Struct
- Fop::Nodes::Text
- Defined in:
- lib/fop/nodes.rb
Instance Attribute Summary collapse
-
#str ⇒ Object
Returns the value of attribute str.
-
#wildcard ⇒ Object
Returns the value of attribute wildcard.
Instance Method Summary collapse
Instance Attribute Details
#str ⇒ Object
Returns the value of attribute str
3 4 5 |
# File 'lib/fop/nodes.rb', line 3 def str @str end |
#wildcard ⇒ Object
Returns the value of attribute wildcard
3 4 5 |
# File 'lib/fop/nodes.rb', line 3 def wildcard @wildcard end |
Instance Method Details
#consume!(input) ⇒ Object
4 5 6 7 |
# File 'lib/fop/nodes.rb', line 4 def consume!(input) @regex ||= Regexp.new((wildcard ? ".*" : "^") + Regexp.escape(str)) input.slice!(@regex) end |
#to_s ⇒ Object
9 10 11 12 |
# File 'lib/fop/nodes.rb', line 9 def to_s w = wildcard ? "*" : nil "Text #{w}#{str}" end |