Module: UnipassApi::Config

Included in:
UnipassApi
Defined in:
lib/unipass_api/config.rb

Overview

Defines constants and methods related to configuration

Constant Summary collapse

VALID_OPTIONS_KEYS =

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

[
  :client_id,
  :client_secret,
  :site,
  :api_site,
  :authorize_url,
  :token_url
]

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:



17
18
19
20
# File 'lib/unipass_api/config.rb', line 17

def configure
  yield self
  self
end

#optionsObject

Create a hash of options and their values



23
24
25
26
27
# File 'lib/unipass_api/config.rb', line 23

def options
  options = {}
  VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}
  options
end