Sha256: 01dbeaf026f6dbcd114ccc685e9cdf29e3c9c17407359311f71f21bce05b8cc2

Contents?: true

Size: 600 Bytes

Versions: 10

Compression:

Stored size: 600 Bytes

Contents

module Tumblr
  
  module Config

    VALID_OPTIONS_KEYS = [
      :consumer_key,
      :consumer_secret,
      :oauth_token,
      :oauth_token_secret
    ]
    
    attr_accessor *VALID_OPTIONS_KEYS

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

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

  end

end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
tumblr_client-0.6.11 lib/tumblr/config.rb
tumblr_client-0.6.9 lib/tumblr/config.rb
tumblr_client-0.6.8 lib/tumblr/config.rb
tumblr_client_faraday_0_8-0.6.7.1 lib/tumblr/config.rb
tumblr_client-0.6.7 lib/tumblr/config.rb
tumblr_client-0.6.6 lib/tumblr/config.rb
tumblr_client-0.6.5 lib/tumblr/config.rb
tumblr_client-0.6.1 lib/tumblr/config.rb
tumblr_client-0.6 lib/tumblr/config.rb
tumblr_client-0.5 lib/tumblr/config.rb