Sha256: 7de31d40354df419ab80a8563bc13889ee7079d4d685f9f4c8949719a6d7a122

Contents?: true

Size: 835 Bytes

Versions: 1

Compression:

Stored size: 835 Bytes

Contents

module Fb
  # Setter for shared global objects
  # @private
  class Configuration
    attr_accessor :client_id, :client_secret

    def initialize
      @client_id = ENV['FB_CLIENT_ID']
      @client_secret = ENV['FB_CLIENT_SECRET']
    end
  end

  # Returns the global [Configuration](Fb/Configuration) object. While
  # you can use this method to access the configuration, the more common
  # convention is to use [Fb.configure].
  #
  # @example
  #     Fb.configuration.fb_client_id = 1234
  def self.configuration
    @configuration ||= Configuration.new
  end

  # Yields the global configuration to a block.
  # @yield [Configuration] global configuration
  #
  # @example
  #     Fb.configure do |config|
  #       config.fb_client_id = 1234
  #     end
  def self.configure
    yield(configuration) if block_given?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fb-auth-0.1.0 lib/fb/configuration.rb