Sha256: 772fa55b602b69e2f8bc65cf661234afab6635b9a2b8c14bd973f46844fba4e2

Contents?: true

Size: 565 Bytes

Versions: 1

Compression:

Stored size: 565 Bytes

Contents

module Garage
  module Strategy
    module Cor
      class Base
        attr_reader :controller, :successor

        def initialize(controller, successor)
          @controller = controller
          @successor = successor
        end

        private

        def request
          @controller.request
        end

        def params
          @controller.params
        end

        def from_header(name)
          canonical = name.to_s.dasherize.split('-').map(&:capitalize).join('-')
          request.headers[canonical]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
garage-strategy-cor-0.1.0.beta1 lib/garage/strategy/cor/base.rb