Class: TwitterTweetBot::Configuration
- Inherits:
-
Object
- Object
- TwitterTweetBot::Configuration
- Includes:
- TwitterTweetBot::Cache::ConfigurationExt
- Defined in:
- lib/twitter_tweet_bot/configuration.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#name ⇒ Object
Returns the value of attribute name.
-
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
#scopes ⇒ Object
Returns the value of attribute scopes.
Attributes included from TwitterTweetBot::Cache::ConfigurationExt
Instance Method Summary collapse
-
#initialize(name: nil, client_id: nil, client_secret: nil, redirect_uri: nil, scopes: []) {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
- #to_hash ⇒ Object
Constructor Details
#initialize(name: nil, client_id: nil, client_secret: nil, redirect_uri: nil, scopes: []) {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/twitter_tweet_bot/configuration.rb', line 9 def initialize( name: nil, client_id: nil, client_secret: nil, redirect_uri: nil, scopes: [] ) @name = name @client_id = client_id @client_secret = client_secret @redirect_uri = redirect_uri @scopes = scopes yield self if block_given? end |
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
3 4 5 |
# File 'lib/twitter_tweet_bot/configuration.rb', line 3 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
3 4 5 |
# File 'lib/twitter_tweet_bot/configuration.rb', line 3 def client_secret @client_secret end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/twitter_tweet_bot/configuration.rb', line 3 def name @name end |
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
3 4 5 |
# File 'lib/twitter_tweet_bot/configuration.rb', line 3 def redirect_uri @redirect_uri end |
#scopes ⇒ Object
Returns the value of attribute scopes.
3 4 5 |
# File 'lib/twitter_tweet_bot/configuration.rb', line 3 def scopes @scopes end |
Instance Method Details
#to_hash ⇒ Object
25 26 27 28 29 |
# File 'lib/twitter_tweet_bot/configuration.rb', line 25 def to_hash instance_variables.each_with_object({}) do |key, hash| hash[key[1..].to_sym] = instance_variable_get(key) end end |