Class: Xbrlware::Linkbase::PresentationLinkbase::Presentation::PresentationArc

Inherits:
Object
  • Object
show all
Defined in:
lib/xbrlware-extras/linkbase.rb

Instance Method Summary collapse

Instance Method Details



139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/xbrlware-extras/linkbase.rb', line 139

def print_tree(indent_count=0)
  indent = " " * indent_count
  output = "#{indent} #{@label}"

  @items.each do |item|
    period=item.context.period
    period_str = period.is_duration? ? "#{period.value["start_date"]} to #{period.value["end_date"]}" : "#{period.value}"
    output += " [#{item.def["xbrli:balance"]}]" unless item.def.nil?
    output += " (#{period_str}) = #{item.value}" unless item.nil?
  end
  puts indent + output

  @children.each { |child| child.print_tree(indent_count+1) }
end