Class: AdHocTemplate::Parser::IterationNode::InnerLabel
- Inherits:
-
Object
- Object
- AdHocTemplate::Parser::IterationNode::InnerLabel
- Defined in:
- lib/ad_hoc_template/parser.rb
Instance Attribute Summary collapse
-
#inner_label ⇒ Object
readonly
Returns the value of attribute inner_label.
Class Method Summary collapse
Instance Method Summary collapse
- #full_label(record) ⇒ Object
-
#initialize(inner_label, cur_label) ⇒ InnerLabel
constructor
A new instance of InnerLabel.
Constructor Details
#initialize(inner_label, cur_label) ⇒ InnerLabel
Returns a new instance of InnerLabel.
88 89 90 91 92 |
# File 'lib/ad_hoc_template/parser.rb', line 88 def initialize(inner_label, cur_label) @inner_label = inner_label @label, @key = inner_label.sub(/\A#/, '').split(/\|/, 2) @cur_label = cur_label end |
Instance Attribute Details
#inner_label ⇒ Object (readonly)
Returns the value of attribute inner_label.
82 83 84 |
# File 'lib/ad_hoc_template/parser.rb', line 82 def inner_label @inner_label end |
Class Method Details
.labels(inner_labels, cur_label) ⇒ Object
84 85 86 |
# File 'lib/ad_hoc_template/parser.rb', line 84 def self.labels(inner_labels, cur_label) inner_labels.map {|label| new(label, cur_label) } end |
Instance Method Details
#full_label(record) ⇒ Object
94 95 96 |
# File 'lib/ad_hoc_template/parser.rb', line 94 def full_label(record) [@cur_label, @label, record[@key]].join('|') end |