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.
-
#dev_environment ⇒ Object
Returns the value of attribute dev_environment.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#timeouts ⇒ Object
Returns the value of attribute timeouts.
- #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
15 16 17 18 19 20 |
# File 'lib/twitter/client.rb', line 15 def initialize( = {}) .each do |key, value| instance_variable_set(:"@#{key}", value) end yield(self) if block_given? 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 |
#dev_environment ⇒ Object
Returns the value of attribute dev_environment.
8 9 10 |
# File 'lib/twitter/client.rb', line 8 def dev_environment @dev_environment end |
#proxy ⇒ Object
Returns the value of attribute proxy.
8 9 10 |
# File 'lib/twitter/client.rb', line 8 def proxy @proxy end |
#timeouts ⇒ Object
Returns the value of attribute timeouts.
8 9 10 |
# File 'lib/twitter/client.rb', line 8 def timeouts @timeouts end |
Instance Method Details
#credentials ⇒ Hash
33 34 35 36 37 38 39 40 |
# File 'lib/twitter/client.rb', line 33 def credentials { consumer_key:, consumer_secret:, token: access_token, token_secret: access_token_secret, } end |
#credentials? ⇒ Boolean
43 44 45 |
# File 'lib/twitter/client.rb', line 43 def credentials? credentials.values.none? { |v| blank_string?(v) } end |
#user_token? ⇒ Boolean
23 24 25 |
# File 'lib/twitter/client.rb', line 23 def user_token? !(blank_string?(access_token) || blank_string?(access_token_secret)) end |