Sha256: cb3fddb6c8fa741c862d024b3256c0a34e672ef1a992aed61d68a01c32716800

Contents?: true

Size: 565 Bytes

Versions: 1

Compression:

Stored size: 565 Bytes

Contents

require 'jerry'

module MultiDbApp
  class Database
    attr_reader :uri

    def initialize(uri)
      @uri = uri
    end
  end

  class Application
    attr_reader :foo_db, :bar_db

    def initialize(foo_db, bar_db)
      @foo_db = foo_db
      @bar_db = bar_db
    end
  end

  class Config < Jerry::Config
    def initialize(foo_uri, bar_uri)
      @foo_uri = foo_uri
      @bar_uri = bar_uri
    end

    named_bind :foo_db, Database, [proc { @foo_uri }]
    named_bind :bar_db, Database, [proc { @bar_uri }]
    bind Application, %i[foo_db bar_db]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jerry-2.0.1 spec/fixtures/multi_db_app.rb