Module: Naver::Configuration

Included in:
Naver
Defined in:
lib/naver/configration.rb,
lib/naver/configuration.rb

Overview

Defines constants and methods related to configuration.

Constant Summary collapse

OPTION_KEYS =

An array of valid keys in the options hash when configuring a Naver::Client.

[:client_id, :client_secret, :redirect_uri, :timeout, :debug].freeze
DEFAULT_USER_AGENT =

The user agent that will be sent to the API endpoint if none is set.

"NAVER Ruby SDK Gem #{Naver::Sdk::VERSION}".freeze
DEFAULT_API_BASE_URI =

Base URI for the NAVER API.

"https://openapi.naver.com".freeze
DEFAULT_OAUTH_BASE_URI =

Base URI for NAVER OAuth.

"https://nid.naver.com".freeze

Instance Method Summary collapse

Instance Method Details

#configure {|_self| ... } ⇒ Object

Convenience method to allow configuration options to be set in a block.

Yields:

  • (_self)

Yield Parameters:



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

def configure
  yield(self)
end

#optionsObject

Creates a hash of options and their values.



24
25
26
27
28
# File 'lib/naver/configration.rb', line 24

def options
  options = {}
  OPTION_KEYS.each { |key| options[key] = send(key) }
  options
end