Sha256: f0a8d1cb3b11c11f5a06de28fbafa45268d96a3367fe227022cb05a0c54bd9b0

Contents?: true

Size: 909 Bytes

Versions: 4

Compression:

Stored size: 909 Bytes

Contents

# coding: utf-8

module ThinReports
  module Core::Shape::TextBlock
    
    # @private
    module Formatter
      # @param [ThinReports::Core::Shape::TextBlock::Format] format
      # @return [ThinReports::Core::Shape::TextBlock::Formatter::Base]
      def self.setup(format)
        klass = if format.format_type.blank?
          Basic
        else
          case format.format_type
          when 'number'   then Number
          when 'datetime' then Datetime
          when 'padding'  then Padding
          else
            raise ThinReports::Errors::UnknownFormatterType
          end
        end
        klass.new(format)
      end
    end
    
  end
end

require 'thinreports/core/shape/text_block/formatter/basic'
require 'thinreports/core/shape/text_block/formatter/datetime'
require 'thinreports/core/shape/text_block/formatter/padding'
require 'thinreports/core/shape/text_block/formatter/number'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
thinreports-0.7.7 lib/thinreports/core/shape/text_block/formatter.rb
thinreports-0.7.6 lib/thinreports/core/shape/text_block/formatter.rb
thinreports-0.7.5 lib/thinreports/core/shape/text_block/formatter.rb
thinreports-0.7.0 lib/thinreports/core/shape/text_block/formatter.rb