Sha256: 877c0dfaf9b842480ff253b18293efe071a568b04585b555304cf11143734366

Contents?: true

Size: 400 Bytes

Versions: 1

Compression:

Stored size: 400 Bytes

Contents

module Axel
  class ControllerBase
    def configured
      should_use_api? ? api_base : proper_base
    end

    def should_use_api?
      config.uses_rails_api? && !!api_base
    rescue NameError
      false
    end

    private

    def api_base
      ::ActionController::API
    end

    def proper_base
      ::ActionController::Base
    end

    def config
      Axel._config
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axel-0.0.1 lib/axel/controller_base.rb