=    Cls.    Cls-

ClsRuby        Cls-,  
  .   :
-   Cls-,      .
      , ..      
  ClsRuby::Tag::tag_make_defined (  ,   
    );
-  -,   ClsRuby::TagFormatter;
-     ClsRuby::Tag::tag_format  ,
   .

ClsRuby     ClsRuby::TagFormatter --
 ClsRuby::OneLineFormatter (  Cls-   )
 ClsRuby::DefaultFormatter (      
   Cls-).

==   

     {project-description}:
  {project-description
    {name <str> }
    {comment <str> }
    {source-files <str>* }
  }
    ProjectDescription,   
     TagProjectDescription:
  require 'cls-ruby'
  require 'cls-ruby/tag_no_value'
  require 'cls-ruby/tag_scalar'
  require 'cls-ruby/tag_scalar_vector'

  require 'cls-ruby/default_formatter'

  ProjectDescription = Struct.new( :name, :comment, :source_files )

  class TagProjectDescription < ClsRuby::TagNoValue
    mandatory_child_tag :name, ClsRuby::TagStringScalar
    mandatory_child_tag :comment, ClsRuby::TagStringScalar
    mandatory_child_tag :source_files, ClsRuby::TagScalarVector,
        :format => ClsRuby::SCALAR_STRING,
        :name => 'source-files'

    default_tag_params :name => 'project-description'

    #     :value ,   ,
    #      .
    def initialize( params = {} )
      super( params )

      tag_handle_opt_param( :value ) do |description|
        @name.value = description.name
        @comment.value = description.comment
        @source_files.value = description.source_files

        #   ,   .
        tag_make_defined
      end
    end
  end

  #      .
  to_be_formatted = TagProjectDescription.new(
      :value => ProjectDescription.new( 'test',
          'this is a test project',
          [ 'first.txt', 'second.txt', 'third.txt' ] ) )

  #       .
  to_be_formatted.tag_format( ClsRuby::DefaultFormatter.new( STDOUT ) )

          
:
  {project-description
          {name "test" }
          {comment "this is a test project" }
          {source-files "first.txt" "second.txt" "third.txt" } }

==       ClsRuby

 ClsRuby::OneLineFormatter  ClsRuby::DefaultFormatter  
 ,     . 
    --     <tt><<</tt>.
 , ,  Ruby  IO, String  Array. 
    ClsRuby    
  ,     (,     ).

# vim:ts=2:sts=2:sw=2:expandtab:ft=txt:tw=78


