Sha256: 988bf6351eb57a592e3d7632c8f3527fa875e9aa700bfe676e14796ccd04183e

Contents?: true

Size: 813 Bytes

Versions: 10

Compression:

Stored size: 813 Bytes

Contents

module Filepreviews
  # @author Jonah Ruiz <jonah@pixelhipsters.com>
  # Configurable module for API key and options
  module Config
    def self.included(base)
      base.extend(self)
    end

    # @!attribute api_key, :secret_key
    # @return [String] API/Secret key to be used
    attr_accessor :api_key, :secret_key

    # Configures api_key and options
    #   Usage example:
    #     Filepreviews.configure do |config|
    #       config.api_key = 'your_api_key_here'
    #       config.secret_key = 'your_api_key_here'
    #     end
    #
    #   Alternate way:
    #     Filepreviews.api_key = ENV['YOUR_API_KEY']
    #     Filepreviews.secret_key = ENV['YOUR_SECRET_KEY']
    #
    # @param <api_key> [String] api/secret key to use
    def configure
      yield self if block_given?
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
filepreviews-2.0.9 lib/filepreviews/config.rb
filepreviews-2.0.8 lib/filepreviews/config.rb
filepreviews-2.0.7 lib/filepreviews/config.rb
filepreviews-2.0.6 lib/filepreviews/config.rb
filepreviews-2.0.5 lib/filepreviews/config.rb
filepreviews-2.0.4 lib/filepreviews/config.rb
filepreviews-2.0.3 lib/filepreviews/config.rb
filepreviews-2.0.2 lib/filepreviews/config.rb
filepreviews-2.0.1 lib/filepreviews/config.rb
filepreviews-2.0.0 lib/filepreviews/config.rb