Sha256: ecbcedf5fc0aa8e3040dddd17d89ee068d2a9cefa34f7a32672295dff529543e

Contents?: true

Size: 563 Bytes

Versions: 5

Compression:

Stored size: 563 Bytes

Contents

# frozen_string_literal: true

module GroupMe
  class Configuration
    API_MAX_GROUPS_PER_PAGE = 500

    attr_writer :access_token, :groups_per_page

    def access_token
      raise MissingConfigurationError unless @access_token

      @access_token
    end

    def groups_per_page
      @groups_per_page || API_MAX_GROUPS_PER_PAGE
    end
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configuration=(configuration)
    @configuration = configuration
  end

  def self.configure
    yield(configuration)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
groupme-api-0.8.0 lib/groupme/configuration.rb
groupme-api-0.7.1 lib/groupme/configuration.rb
groupme-api-0.7.0 lib/groupme/configuration.rb
groupme-api-0.6.1 lib/groupme/configuration.rb
groupme-api-0.6.0 lib/groupme/configuration.rb