Sha256: 63690d19e0826ca74dc598d991ba087ea653119181b311ffa72380568b8961b5

Contents?: true

Size: 586 Bytes

Versions: 1

Compression:

Stored size: 586 Bytes

Contents

module Rad
  module Processors
    class EvaluateFormat < Processor
      def call
        path = workspace.path.must_be.defined
        params = workspace.params.must_be.defined
        
        parts = path.split('.')        
        if parts.size > 1
          format = parts.last
          logger.warn "Two :format parameters!" if params.include?(:format) 
          workspace.params = params.clone
          workspace.params.format = format
        else
          params.format ||= config.default_format!
        end
        
        next_processor.call
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rad_core-0.0.13 lib/rad/http/processors/evaluate_format.rb