Sha256: a611e78fa968a07dbc4e537193c5fa0bf7548a15b2d5065abc5405ec08088398

Contents?: true

Size: 509 Bytes

Versions: 6

Compression:

Stored size: 509 Bytes

Contents

require "yaml"
require "fex/service_factory"

module Fex
  class Client

    attr_reader :globals

    def initialize(globals)
      @globals = globals
    end

    def service(name, locals = {})
      config = service_configuration[name]
      opts = globals.deep_merge(config).deep_merge(locals)
      ServiceFactory.new(name, opts).service
    end

    private

    def service_configuration
      @service_configuration ||= YAML.load_file(File.expand_path("../services.yml", __FILE__))
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fex-0.0.6 lib/fex/client.rb
fex-0.0.5 lib/fex/client.rb
fex-0.0.4 lib/fex/client.rb
fex-0.0.3 lib/fex/client.rb
fex-0.0.2 lib/fex/client.rb
fex-0.0.1 lib/fex/client.rb