Sha256: 444b0af2c39ddcf9f7fa68e2de140079b1178dad5bbb6314808fe5d1336597ff

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

module Caracal
  module Core
    
    # This module encapsulates all the functionality related to setting the 
    # document's name.
    #
    module FileName
      def self.included(base)
        base.class_eval do
          
          #-------------------------------------------------------------
          # Configuration
          #-------------------------------------------------------------
    
          # constants
          const_set(:DEFAULT_FILE_NAME, 'caracal.docx')
          
          # accessors
          attr_reader :name
          
          
          #-------------------------------------------------------------
          # Public Methods
          #-------------------------------------------------------------
    
          # This method sets the name of the output file. Defaults
          # to the name of the library.
          #
          def file_name(value = nil)
            v = value.to_s.strip
            @name = (v == '') ? self.class::DEFAULT_FILE_NAME : v
          end
          
        end
      end
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
caracal-0.1.1 lib/caracal/core/file_name.rb
caracal-0.1.0 lib/caracal/core/file_name.rb