Class: Twitter::Client
Direct Known Subclasses
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#access_token_secret ⇒ Object
Returns the value of attribute access_token_secret.
-
#consumer_key ⇒ Object
Returns the value of attribute consumer_key.
-
#consumer_secret ⇒ Object
Returns the value of attribute consumer_secret.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
- #user_agent ⇒ String
Instance Method Summary collapse
- #credentials ⇒ Hash
- #credentials? ⇒ Boolean
-
#initialize(options = {}) {|_self| ... } ⇒ Twitter::Client
constructor
Initializes a new Client object.
- #user_token? ⇒ Boolean
Methods included from Utils
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Twitter::Client
Initializes a new Client object
19 20 21 22 23 24 25 |
# File 'lib/twitter/client.rb', line 19 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? validate_credentials! end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
8 9 10 |
# File 'lib/twitter/client.rb', line 8 def access_token @access_token end |
#access_token_secret ⇒ Object
Returns the value of attribute access_token_secret.
8 9 10 |
# File 'lib/twitter/client.rb', line 8 def access_token_secret @access_token_secret end |
#consumer_key ⇒ Object
Returns the value of attribute consumer_key.
8 9 10 |
# File 'lib/twitter/client.rb', line 8 def consumer_key @consumer_key end |
#consumer_secret ⇒ Object
Returns the value of attribute consumer_secret.
8 9 10 |
# File 'lib/twitter/client.rb', line 8 def consumer_secret @consumer_secret end |
#proxy ⇒ Object
Returns the value of attribute proxy.
8 9 10 |
# File 'lib/twitter/client.rb', line 8 def proxy @proxy end |
Instance Method Details
#credentials ⇒ Hash
38 39 40 41 42 43 44 45 46 |
# File 'lib/twitter/client.rb', line 38 def credentials { :consumer_key => consumer_key, :consumer_secret => consumer_secret, :token => access_token, :token_secret => access_token_secret, :ignore_extra_keys => true, } end |
#credentials? ⇒ Boolean
49 50 51 |
# File 'lib/twitter/client.rb', line 49 def credentials? credentials.values.all? end |
#user_token? ⇒ Boolean
28 29 30 |
# File 'lib/twitter/client.rb', line 28 def user_token? !!(access_token && access_token_secret) end |