Class/Module Index [+]

Quicksearch

Twitter::Configurable

Attributes

bearer_token[W]
connection_options[RW]
consumer_key[RW]
consumer_secret[W]
endpoint[RW]
identity_map[RW]
middleware[RW]
oauth_token[W]
oauth_token_secret[W]

Public Class Methods

keys() click to toggle source
# File lib/twitter/configurable.rb, line 14
def keys
  @keys ||= [
    :consumer_key,
    :consumer_secret,
    :oauth_token,
    :oauth_token_secret,
    :bearer_token,
    :endpoint,
    :connection_options,
    :identity_map,
    :middleware,
  ]
end

Public Instance Methods

bearer_token?() click to toggle source

@return [Boolean]

# File lib/twitter/configurable.rb, line 54
def bearer_token?
  !!@bearer_token
end
configure() click to toggle source

Convenience method to allow configuration options to be set in a block

@raise [Twitter::Error::ConfigurationError] Error is raised when supplied

twitter credentials are not a String or Symbol.
# File lib/twitter/configurable.rb, line 34
def configure
  yield self
  validate_credential_type!
  self
end
credentials?() click to toggle source

@return [Boolean]

# File lib/twitter/configurable.rb, line 59
def credentials?
  credentials.values.all? || bearer_token?
end
reset!() click to toggle source
# File lib/twitter/configurable.rb, line 40
def reset!
  Twitter::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", Twitter::Default.options[key])
  end
  self
end
Also aliased as: setup
setup() click to toggle source
Alias for: reset!
user_token?() click to toggle source

@return [Boolean]

# File lib/twitter/configurable.rb, line 49
def user_token?
  !!(@oauth_token && @oauth_token_secret)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.