Module: Twitter::Configurable
Instance Attribute Summary (collapse)
-
- (Object) bearer_token
writeonly
Sets the attribute bearer_token.
-
- (Object) connection_options
Returns the value of attribute connection_options.
-
- (Object) consumer_key
Returns the value of attribute consumer_key.
-
- (Object) consumer_secret
writeonly
Sets the attribute consumer_secret.
-
- (Object) endpoint
Returns the value of attribute endpoint.
-
- (Object) identity_map
Returns the value of attribute identity_map.
-
- (Object) middleware
Returns the value of attribute middleware.
-
- (Object) oauth_token
writeonly
Sets the attribute oauth_token.
-
- (Object) oauth_token_secret
writeonly
Sets the attribute oauth_token_secret.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Boolean) bearer_token?
-
- (Object) configure {|_self| ... }
Convenience method to allow configuration options to be set in a block.
- - (Boolean) credentials?
- - (Object) reset! (also: #setup)
- - (Boolean) user_token?
Instance Attribute Details
- (Object) bearer_token=(value) (writeonly)
Sets the attribute bearer_token
8 9 10 |
# File 'lib/twitter/configurable.rb', line 8 def bearer_token=(value) @bearer_token = value end |
- (Object) connection_options
Returns the value of attribute connection_options
9 10 11 |
# File 'lib/twitter/configurable.rb', line 9 def @connection_options end |
- (Object) consumer_key
Returns the value of attribute consumer_key
9 10 11 |
# File 'lib/twitter/configurable.rb', line 9 def consumer_key @consumer_key end |
- (Object) consumer_secret=(value) (writeonly)
Sets the attribute consumer_secret
8 9 10 |
# File 'lib/twitter/configurable.rb', line 8 def consumer_secret=(value) @consumer_secret = value end |
- (Object) endpoint
Returns the value of attribute endpoint
9 10 11 |
# File 'lib/twitter/configurable.rb', line 9 def endpoint @endpoint end |
- (Object) identity_map
Returns the value of attribute identity_map
9 10 11 |
# File 'lib/twitter/configurable.rb', line 9 def identity_map @identity_map end |
- (Object) middleware
Returns the value of attribute middleware
9 10 11 |
# File 'lib/twitter/configurable.rb', line 9 def middleware @middleware end |
- (Object) oauth_token=(value) (writeonly)
Sets the attribute oauth_token
8 9 10 |
# File 'lib/twitter/configurable.rb', line 8 def oauth_token=(value) @oauth_token = value end |
- (Object) oauth_token_secret=(value) (writeonly)
Sets the attribute oauth_token_secret
8 9 10 |
# File 'lib/twitter/configurable.rb', line 8 def oauth_token_secret=(value) @oauth_token_secret = value end |
Class Method Details
+ (Object) keys
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# 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 |
Instance Method Details
- (Boolean) bearer_token?
54 55 56 |
# File 'lib/twitter/configurable.rb', line 54 def bearer_token? !!@bearer_token end |
- (Object) configure {|_self| ... }
Convenience method to allow configuration options to be set in a block
34 35 36 37 38 |
# File 'lib/twitter/configurable.rb', line 34 def configure yield self validate_credential_type! self end |
- (Boolean) credentials?
59 60 61 |
# File 'lib/twitter/configurable.rb', line 59 def credentials? credentials.values.all? || bearer_token? end |
- (Object) reset! Also known as: setup
40 41 42 43 44 45 |
# File 'lib/twitter/configurable.rb', line 40 def reset! Twitter::Configurable.keys.each do |key| instance_variable_set(:@#{key}", Twitter::Default.[key]) end self end |
- (Boolean) user_token?
49 50 51 |
# File 'lib/twitter/configurable.rb', line 49 def user_token? !!(@oauth_token && @oauth_token_secret) end |