Sha256: 9d526b77f8a65377c7fa8ffb0a40708b6b27215857a6271fa37a487d88efeb98

Contents?: true

Size: 757 Bytes

Versions: 2

Compression:

Stored size: 757 Bytes

Contents

require 'alephant/logger'

module Alephant
  module Broker
    module Response
      class Asset < Base
        include Logger

        def initialize(component)
          @component = component
          super component.status
        end

        def setup
          @headers.merge!(@component.headers)
          @content  = @component.content
          log if @component.is_a? Component
        end

        private

        def batched
          @component.batch_id.nil? ? '' : 'batched'
        end

        def details
          c = @component
          "#{c.id}/#{c.options}/#{c.headers} #{batched} #{c.options}"
        end

        def log
          logger.info "Broker: Component loaded! #{details} (200)"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alephant-broker-3.6.1 lib/alephant/broker/response/asset.rb
alephant-broker-3.6.0 lib/alephant/broker/response/asset.rb