Module: Twitter::Configurable

### Home Classes Methods

### In Files

- lib/twitter/configurable.rb

### Methods

- ::keys
- #configure
- #credentials?
- #reset!
- #setup

### Class/Module Index

Quicksearch

- Twitter
- Twitter::API
- Twitter::API::Arguments
- Twitter::API::DirectMessages
- Twitter::API::Favorites
- Twitter::API::FriendsAndFollowers
- Twitter::API::Help
- Twitter::API::Lists
- Twitter::API::PlacesAndGeo
- Twitter::API::SavedSearches
- Twitter::API::Search
- Twitter::API::SpamReporting
- Twitter::API::SuggestedUsers
- Twitter::API::Timelines
- Twitter::API::Trends
- Twitter::API::Tweets
- Twitter::API::Undocumented
- Twitter::API::Users
- Twitter::API::Utils
- Twitter::Action
- Twitter::Action::Favorite
- Twitter::Action::Follow
- Twitter::Action::ListMemberAdded
- Twitter::Action::Mention
- Twitter::Action::Reply
- Twitter::Action::Retweet
- Twitter::Action::Status
- Twitter::Action::Tweet
- Twitter::ActionFactory
- Twitter::Base
- Twitter::BasicUser
- Twitter::Client
- Twitter::Configurable
- Twitter::Configuration
- Twitter::Creatable
- Twitter::Cursor
- Twitter::Default
- Twitter::DirectMessage
- Twitter::Entity
- Twitter::Entity::Hashtag
- Twitter::Entity::Url
- Twitter::Entity::UserMention
- Twitter::Error
- Twitter::Error::AlreadyFavorited
- Twitter::Error::AlreadyRetweeted
- Twitter::Error::BadGateway
- Twitter::Error::BadRequest
- Twitter::Error::ClientError
- Twitter::Error::ConfigurationError
- Twitter::Error::DecodeError
- Twitter::Error::EnhanceYourCalm
- Twitter::Error::Forbidden
- Twitter::Error::GatewayTimeout
- Twitter::Error::IdentityMapKeyError
- Twitter::Error::InternalServerError
- Twitter::Error::NotAcceptable
- Twitter::Error::NotFound
- Twitter::Error::RateLimited
- Twitter::Error::ServerError
- Twitter::Error::ServiceUnavailable
- Twitter::Error::TooManyRequests
- Twitter::Error::Unauthorized
- Twitter::Error::UnprocessableEntity
- Twitter::Exceptable
- Twitter::Factory
- Twitter::Geo
- Twitter::Geo::Point
- Twitter::Geo::Polygon
- Twitter::GeoFactory
- Twitter::Identity
- Twitter::IdentityMap
- Twitter::Language
- Twitter::List
- Twitter::Media
- Twitter::Media::Photo
- Twitter::MediaFactory
- Twitter::Metadata
- Twitter::OEmbed
- Twitter::Place
- Twitter::ProfileBanner
- Twitter::RateLimit
- Twitter::Relationship
- Twitter::Request
- Twitter::Request::MultipartWithFile
- Twitter::Response
- Twitter::Response::ParseJson
- Twitter::Response::RaiseError
- Twitter::SavedSearch
- Twitter::SearchResults
- Twitter::Settings
- Twitter::Size
- Twitter::SourceUser
- Twitter::Status
- Twitter::Suggestion
- Twitter::TargetUser
- Twitter::Trend
- Twitter::Tweet
- Twitter::User
- Twitter::Version
- Enumerable
- Kernel

No matching classes.

# Twitter::Configurable

### Attributes

connection_options[RW]
consumer_key[W]
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 13
    def keys
      @keys ||= [
        :consumer_key,
        :consumer_secret,
        :oauth_token,
        :oauth_token_secret,
        :endpoint,
        :connection_options,
        :identity_map,
        :middleware,
      ]
    end

### Public Instance Methods

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 32
    def configure
      yield self
      validate_credential_type!
      self
    end

credentials?() click to toggle source

@return [Boolean]

    # File lib/twitter/configurable.rb, line 39
    def credentials?
      credentials.values.all?
    end

reset!() click to toggle source

    # File lib/twitter/configurable.rb, line 43
    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!

[Validate]

Generated with the Darkfish Rdoc Generator 2.