File: model/document/overview.rb

Overview
Module Structure
Class Hierarchy
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: TmDoc#10
  module: Model
  module: Document#12
  module: Overview#14
  class: Overview#16
inherits from
  Document ( TmDoc::Model::Document::Abstraction )
has properties
attribute: a_module_structure [R] #17
attribute: a_class_hierarchy [R] #18
attribute: a_source_structure [R] #19
method: initialize / 3 #22
method: print #35

Code

   1  # $Id: overview.rb,v 1.3 2011/11/30 19:26:34 machan Exp $
   2 
   3  require 'stringio'
   4 
   5  require 'tmdoc/constant'
   6  require 'tmdoc/model/document/abstraction'
   7  require 'tmdoc/model/document/link'
   8 
   9 
  10  module TmDoc
  11 
  12  module Model::Document
  13 
  14  module Overview
  15 
  16  class Overview < Abstraction::Document
  17      attr_reader :a_module_structure,
  18                  :a_class_hierarchy,
  19                  :a_source_structure
  20 
  21 
  22      def initialize(
  23          a_module_structure, a_class_hierarchy, a_source_structure
  24      )
  25          ASSERT.opt_kind_of a_module_structure,  MDN::ModuleStructure
  26          ASSERT.opt_kind_of a_class_hierarchy,   MDN::ClassHierarchy
  27          ASSERT.opt_kind_of a_source_structure,  MDN::SourceStructure
  28 
  29          @a_module_structure = a_module_structure
  30          @a_class_hierarchy  = a_class_hierarchy
  31          @a_source_structure = a_source_structure
  32      end
  33 
  34 
  35      def print
  36          str_io = StringIO.new
  37 
  38          LOG::Debug.log '-- Module Structure --'
  39          if self.a_module_structure
  40              str_io.string = ''
  41              self.a_module_structure.print_tree(str_io)
  42              LOG::Debug.log str_io.string
  43              LOG::Debug.log
  44          end
  45 
  46          LOG::Debug.log '-- Class Hierarchy --'
  47          if self.a_class_hierarchy
  48              str_io.string = ''
  49              self.a_class_hierarchy.print_tree(str_io)
  50              LOG::Debug.log str_io.string
  51              LOG::Debug.log
  52          end
  53 
  54          LOG::Debug.log '-- Source Structure --'
  55          if self.a_source_structure
  56              self.a_source_structure.print
  57          end
  58 
  59          nil
  60      end
  61  end
  62 
  63  end # TmDoc::Model::Document::Overview
  64 
  65  end # TmDoc::Model::Document
  66 
  67  end # TmDoc