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
]

Instance Method Summary collapse

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:


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

def configure
  yield self
  self
end

#credentialsObject


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

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

#optionsObject


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

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