Sha256: b2154171a019670e0ae1db1feae3b1f317cc90951d517e1ff964e99802e73ca4

Contents?: true

Size: 487 Bytes

Versions: 2

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

module Async::App::Component
  def self.included(base)
    base.extend(Async::App::Injector)
    base.inject(:bus)

    base.include(Async::Logger)

    strict = Dry.Types::Strict

    string_like = (strict::String | strict::Symbol).constructor(&:to_s)
    kv = strict::Hash.map(string_like, strict::String)

    base.const_set(:T, Module.new do
      include Dry.Types
      const_set(:StringLike, string_like)
      const_set(:KV, kv)
    end)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
async-tools-0.2.4 lib/async/app/component.rb
async-tools-0.2.2 lib/async/app/component.rb