Class: AdHocTemplate::Parser::IterationNode::InnerLabel

Inherits:
Object
  • Object
show all
Defined in:
lib/ad_hoc_template/parser.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_labelObject (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