Module: StartupStats::Configurable
- Included in:
- Countdb, StartupStats::Countdb::Client, Formd, Formd::Client
- Defined in:
- lib/startupstats/configurable.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
writeonly
Sets the attribute access_token.
-
#access_token_key ⇒ Object
Returns the value of attribute access_token_key.
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#middleware ⇒ Object
Returns the value of attribute middleware.
Class Method Summary collapse
Instance Method Summary collapse
- #cache_key ⇒ Fixnum
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block.
- #credentials? ⇒ Boolean
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#access_token=(value) ⇒ Object (writeonly)
Sets the attribute access_token
4 5 6 |
# File 'lib/startupstats/configurable.rb', line 4 def access_token=(value) @access_token = value end |
#access_token_key ⇒ Object
Returns the value of attribute access_token_key.
5 6 7 |
# File 'lib/startupstats/configurable.rb', line 5 def access_token_key @access_token_key end |
#connection_options ⇒ Object
Returns the value of attribute connection_options.
5 6 7 |
# File 'lib/startupstats/configurable.rb', line 5 def @connection_options end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'lib/startupstats/configurable.rb', line 5 def endpoint @endpoint end |
#middleware ⇒ Object
Returns the value of attribute middleware.
5 6 7 |
# File 'lib/startupstats/configurable.rb', line 5 def middleware @middleware end |
Class Method Details
.keys ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/startupstats/configurable.rb', line 9 def keys @keys ||= [ :access_token, :access_token_key, :endpoint, :connection_options, :middleware, ] end |
Instance Method Details
#cache_key ⇒ Fixnum
33 34 35 |
# File 'lib/startupstats/configurable.rb', line 33 def cache_key .hash end |
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
22 23 24 25 |
# File 'lib/startupstats/configurable.rb', line 22 def configure yield self self end |
#credentials? ⇒ Boolean
28 29 30 |
# File 'lib/startupstats/configurable.rb', line 28 def credentials? credentials.values.all? end |
#reset! ⇒ Object Also known as: setup
37 38 39 40 41 42 |
# File 'lib/startupstats/configurable.rb', line 37 def reset! StartupStats::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", StartupStats::Default.[key]) end self end |