Class: Sablon::Parser::MailMerge::MergeField
- Inherits:
-
Object
- Object
- Sablon::Parser::MailMerge::MergeField
- Defined in:
- lib/sablon/parser/mail_merge.rb
Direct Known Subclasses
Constant Summary collapse
- KEY_PATTERN =
/^\s*MERGEFIELD\s+([^ ]+)\s+\\\*\s+MERGEFORMAT\s*$/
Instance Attribute Summary collapse
-
#block_reference_count ⇒ Object
Returns the value of attribute block_reference_count.
Instance Method Summary collapse
- #expression ⇒ Object
-
#initialize ⇒ MergeField
constructor
A new instance of MergeField.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ MergeField
Returns a new instance of MergeField.
8 9 10 |
# File 'lib/sablon/parser/mail_merge.rb', line 8 def initialize @block_reference_count = 0 end |
Instance Attribute Details
#block_reference_count ⇒ Object
Returns the value of attribute block_reference_count.
5 6 7 |
# File 'lib/sablon/parser/mail_merge.rb', line 5 def block_reference_count @block_reference_count end |
Instance Method Details
#expression ⇒ Object
16 17 18 |
# File 'lib/sablon/parser/mail_merge.rb', line 16 def expression $1 if @raw_expression =~ KEY_PATTERN end |
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/sablon/parser/mail_merge.rb', line 12 def valid? expression end |