Sha256: 6c496e20800938768bad71065eca3f43d0e0c7a2f386dfc6bb1d8272bf9772e8

Contents?: true

Size: 473 Bytes

Versions: 6

Compression:

Stored size: 473 Bytes

Contents

# frozen_string_literal: true

module Clowne
  module DSL # :nodoc: all
    def adapter(adapter = nil)
      if adapter.nil?
        return @_adapter if instance_variable_defined?(:@_adapter)

        @_adapter = Clowne.default_adapter
      else
        @_adapter = Clowne.resolve_adapter(adapter)
      end
    end

    private

    def current_adapter(user_adapter)
      return adapter if user_adapter.nil?

      Clowne.resolve_adapter(user_adapter)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
clowne-1.5.0 lib/clowne/dsl.rb
clowne-1.4.0 lib/clowne/dsl.rb
clowne-1.3.0 lib/clowne/dsl.rb
clowne-1.2.0 lib/clowne/dsl.rb
clowne-1.1.0 lib/clowne/dsl.rb
clowne-1.0.0 lib/clowne/dsl.rb