Module: Quizlet

Defined in:
lib/quizlet.rb,
lib/quizlet/sets.rb,
lib/quizlet/client.rb

Defined Under Namespace

Modules: Sets Classes: Client

Constant Summary collapse

CONNECTION_OPTIONS =
{
  headers: {
    accept: 'application/json',
    user_agent: 'quizlet-ruby client'
  }
}

Class Method Summary collapse

Class Method Details

.clientObject



9
10
11
12
# File 'lib/quizlet.rb', line 9

def client
  @client = Quizlet::Client.new({access_token: @access_token, client_id: @client_id})
  @client
end

.configure(opts) ⇒ Object

Not the place to put this…duplicated



4
5
6
7
# File 'lib/quizlet.rb', line 4

def configure(opts)
  @access_token = opts[:access_token]
  @client_id = opts[:client_id]
end

.respond_to?(method, include_all = false) ⇒ Boolean

Delegate all calls to the client instance, top level module for convenience

Returns:

  • (Boolean)


19
20
21
# File 'lib/quizlet.rb', line 19

def respond_to?(method, include_all=false)
  client.respond_to?(method, include_all) || super
end

.respond_to_missing?(method, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/quizlet.rb', line 14

def respond_to_missing?(method, include_all=false)
  client.respond_to?(method, include_all)
end