Module: Topsy::Configurable
Instance Attribute Summary collapse
-
#api_key ⇒ Object
writeonly
Sets the attribute api_key.
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.
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#api_key=(value) ⇒ Object (writeonly)
Sets the attribute api_key
4 5 6 |
# File 'lib/topsy/configurable.rb', line 4 def api_key=(value) @api_key = value end |
Class Method Details
.keys ⇒ Object
8 9 10 11 12 |
# File 'lib/topsy/configurable.rb', line 8 def keys @keys ||= [ :api_key ] end |
Instance Method Details
#cache_key ⇒ Fixnum
23 24 25 |
# File 'lib/topsy/configurable.rb', line 23 def cache_key .hash end |
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
17 18 19 20 |
# File 'lib/topsy/configurable.rb', line 17 def configure yield self self end |
#reset! ⇒ Object Also known as: setup
27 28 29 30 31 32 |
# File 'lib/topsy/configurable.rb', line 27 def reset! Topsy::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Topsy::Default.[key]) end self end |