Sha256: 4f181cee2baead19b9972c069ca9c93959b63d52848c9b25f224064c5d80bc81

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

require File.expand_path('connection', __dir__)
require File.expand_path('request', __dir__)
require File.expand_path('oauth', __dir__)

module RubyInstagram
  class API
    attr_accessor(*Configuration::VALID_OPTIONS_KEYS)

    # Creates a new API
    def initialize(options = {})
      options = RubyInstagram.options.merge(options)
      Configuration::VALID_OPTIONS_KEYS.each do |key|
        send("#{key}=", options[key])
      end
    end

    def config
      {}.tap do |conf|
        Configuration::VALID_OPTIONS_KEYS.each do |key|
          conf[key] = send(key)
        end
      end
    end

    include Connection
    include Request
    include OAuth
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_instagram-0.1.0 lib/ruby_instagram/api.rb