class Hippo_eyeDoc::TransactionSets::RepeatingComponent
Public Class Methods
new(component_entry, parent)
click to toggle source
# File lib/hippo_eyeDoc/transaction_sets/repeating_component.rb, line 7 def initialize(component_entry, parent) @component_entry = component_entry @parent = parent end
Public Instance Methods
ancestors()
click to toggle source
# File lib/hippo_eyeDoc/transaction_sets/repeating_component.rb, line 34 def ancestors if parent parent.ancestors.flatten else [] end end
build() { |component| ... }
click to toggle source
# File lib/hippo_eyeDoc/transaction_sets/repeating_component.rb, line 12 def build component = @component_entry.populate_component(@component_entry.klass.new(:parent => @parent)) push(component) yield component if block_given? component end
method_missing(method_name, *args, &block)
click to toggle source
# File lib/hippo_eyeDoc/transaction_sets/repeating_component.rb, line 42 def method_missing(method_name, *args, &block) build if self.length == 0 self.first.send(method_name, *args, &block) end
segment_count()
click to toggle source
# File lib/hippo_eyeDoc/transaction_sets/repeating_component.rb, line 30 def segment_count segments.length end
segments()
click to toggle source
# File lib/hippo_eyeDoc/transaction_sets/repeating_component.rb, line 24 def segments return [] unless self.length != 0 self.map(&:segments).flatten end
to_s()
click to toggle source
# File lib/hippo_eyeDoc/transaction_sets/repeating_component.rb, line 20 def to_s self.map(&:to_s).join end