Sha256: 0409dbd456b1168d367bc1ca6906ee94d5d7d5c1fc1a109193680c644a97c1e3

Contents?: true

Size: 637 Bytes

Versions: 15

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

module PriceHubble
  # A bunch of top-level client helpers.
  module Client
    extend ActiveSupport::Concern

    class_methods do
      # Get a low level client for the requested application. This returns an
      # already instanciated client object, ready to use.
      #
      # @param name [Symbol, String] the client name
      # @return [PriceHubble::Client::Base] a compatible client instance
      def client(name)
        name
          .to_s
          .underscore
          .camelize
          .prepend('PriceHubble::Client::')
          .constantize
          .new
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
pricehubble-1.3.0 lib/price_hubble/client.rb
pricehubble-1.2.5 lib/price_hubble/client.rb
pricehubble-1.2.4 lib/price_hubble/client.rb
pricehubble-1.2.3 lib/price_hubble/client.rb
pricehubble-1.2.2 lib/price_hubble/client.rb
pricehubble-1.2.1 lib/price_hubble/client.rb
pricehubble-1.2.0 lib/price_hubble/client.rb
pricehubble-1.1.0 lib/pricehubble/client.rb
pricehubble-1.0.0 lib/pricehubble/client.rb
pricehubble-0.4.2 lib/pricehubble/client.rb
pricehubble-0.4.1 lib/pricehubble/client.rb
pricehubble-0.4.0 lib/pricehubble/client.rb
pricehubble-0.3.0 lib/pricehubble/client.rb
pricehubble-0.2.0 lib/pricehubble/client.rb
pricehubble-0.1.0 lib/pricehubble/client.rb