Module: Tumblr::Config

Included in:
Tumblr
Defined in:
lib/tumblr/config.rb

Constant Summary collapse

VALID_OPTIONS_KEYS =
[
  :consumer_key,
  :consumer_secret,
  :oauth_token,
  :oauth_token_secret,
  :client,
  :api_scheme
]

Instance Method Summary collapse

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:



15
16
17
18
# File 'lib/tumblr/config.rb', line 15

def configure
  yield self
  self
end

#credentialsObject



26
27
28
29
30
31
32
33
# File 'lib/tumblr/config.rb', line 26

def credentials
  {
    :consumer_key => consumer_key,
    :consumer_secret => consumer_secret,
    :token => oauth_token,
    :token_secret => oauth_token_secret
  }
end

#optionsObject



20
21
22
23
24
# File 'lib/tumblr/config.rb', line 20

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