File: transformer/module-into-object/path.rb

Overview
Module Structure
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: TmDoc#9
  module: Transformer
  module: ModuleIntoObject#11
  module: Path#13
has properties
function: transform_paths / 1 #17
function: transform / 1 #28

Code

   1  # $Id: path.rb,v 1.4 2012/04/17 02:19:08 machan Exp $
   2 
   3  require 'tmdoc/tmstd'
   4  require 'tmdoc/constant'
   5  require 'tmdoc/model/module'
   6  require 'tmdoc/model/object'
   7 
   8 
   9  module TmDoc
  10 
  11  module Transformer::ModuleIntoObject
  12 
  13  module Path
  14 
  15  module_function
  16 
  17      def transform_paths(mm_paths)
  18          ASSERT.opt_kind_of mm_paths, MMLP::SetOfPath
  19 
  20          return nil unless mm_paths
  21 
  22          MOL::SetOfPath.new(
  23              mm_paths.map { |mm_path| transform mm_path }
  24          )
  25      end
  26 
  27 
  28      def transform(mm_path)
  29          ASSERT.opt_kind_of mm_path, MMLP::AbsolutePath
  30 
  31          return nil unless mm_path
  32 
  33          MOL::Path.new mm_path.to_a
  34      end
  35  end
  36 
  37  end # TmDoc::Transformer::ModuleIntoObject
  38 
  39  end # TmDoc