Sha256: 80ac2f7014ce9356a9056c6c9c98b6664ce36d1d94867e4b130ed7ee4bae1a2e

Contents?: true

Size: 733 Bytes

Versions: 10

Compression:

Stored size: 733 Bytes

Contents

require 'alephant/publisher/request/processor/base'
require 'alephant/renderer'

module Alephant
  module Publisher
    module Request
      class Processor < BaseProcessor
        attr_reader :base_path

        def initialize(base_path)
          @base_path = base_path
        end

        def consume(data, component)
          config = config_for component
          renderer_for(config, data).views[component].render
        end

        def renderer_for(config, data)
          Alephant::Renderer.create(config, data)
        end

        protected

        def config_for(component)
          {
            :renderer_id => component,
            :view_path   => base_path
          }
        end

      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
alephant-publisher-request-0.3.0 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.2.6 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.2.5 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.2.4 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.2.3 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.2.2 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.2.1 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.2.0 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.1.2 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.1.1 lib/alephant/publisher/request/processor.rb