Sha256: 245e3342262b46085f0904c1fdf52b27c1fccfee51626d20b44c870dbbd2f9a5

Contents?: true

Size: 1.03 KB

Versions: 41

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'avm/eac_postgresql_base0/instance/data_unit'
require 'eac_ruby_utils/core_ext'

module Avm
  module EacPostgresqlBase0
    class Instance
      require_sub __FILE__, include_modules: true

      DEFAULT_HOSTNAME = '127.0.0.1'
      DEFAULT_PORT = 5432
      DEFAULT_SCHEMA = 'public'
      MAINTENANCE_DATABASE = 'postgres'

      common_constructor :env, :connection_params do
        self.connection_params = connection_params.with_indifferent_access
      end

      def assert
        ::Avm::EacPostgresqlBase0::Instance::Assert.new(self).perform
      end

      def host
        connection_params[:host] || DEFAULT_HOSTNAME
      end

      def port
        connection_params[:port] || DEFAULT_PORT
      end

      def user
        connection_params.fetch(:user)
      end

      def password
        connection_params.fetch(:password)
      end

      def name
        connection_params.fetch(:name)
      end

      def schema
        connection_params[:schema] || DEFAULT_SCHEMA
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
avm-eac_postgresql_base0-0.5.3 lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.86.3 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.86.2 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.86.1 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.86.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.85.1 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.85.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.84.2 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.84.1 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.84.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.83.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.82.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.81.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.80.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.79.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.78.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.77.1 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.77.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.76.1 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
eac_tools-0.76.0 sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb