Sha256: 090a8ff5769e62274bf8bbbdef18894c14c4b48ddbccaea63ec400a5856c9be8

Contents?: true

Size: 705 Bytes

Versions: 2

Compression:

Stored size: 705 Bytes

Contents

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

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

2 entries across 2 versions & 1 rubygems

Version Path
alephant-publisher-request-0.0.3 lib/alephant/publisher/request/processor.rb
alephant-publisher-request-0.0.2 lib/alephant/publisher/request/processor.rb