Sha256: 26d016c37c12ae95edc2c02322f88e4d08b8f34e5f772e64aa7e7bb1a619898a

Contents?: true

Size: 592 Bytes

Versions: 6

Compression:

Stored size: 592 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{ |pname| options[pname] = send(pname) }
      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

6 entries across 6 versions & 1 rubygems

Version Path
tumblr_client-0.7.5 lib/tumblr/config.rb
tumblr_client-0.7.4 lib/tumblr/config.rb
tumblr_client-0.7.3 lib/tumblr/config.rb
tumblr_client-0.7.2 lib/tumblr/config.rb
tumblr_client-0.7.1 lib/tumblr/config.rb
tumblr_client-0.7.0 lib/tumblr/config.rb