Module: Wayback::Configurable
Instance Attribute Summary collapse
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#endpoint_path ⇒ Object
Returns the value of attribute endpoint_path.
-
#identity_map ⇒ Object
Returns the value of attribute identity_map.
-
#middleware ⇒ Object
Returns the value of attribute middleware.
Class Method Summary collapse
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block.
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#connection_options ⇒ Object
Returns the value of attribute connection_options.
7 8 9 |
# File 'lib/wayback/configurable.rb', line 7 def @connection_options end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
7 8 9 |
# File 'lib/wayback/configurable.rb', line 7 def endpoint @endpoint end |
#endpoint_path ⇒ Object
Returns the value of attribute endpoint_path.
7 8 9 |
# File 'lib/wayback/configurable.rb', line 7 def endpoint_path @endpoint_path end |
#identity_map ⇒ Object
Returns the value of attribute identity_map.
7 8 9 |
# File 'lib/wayback/configurable.rb', line 7 def identity_map @identity_map end |
#middleware ⇒ Object
Returns the value of attribute middleware.
7 8 9 |
# File 'lib/wayback/configurable.rb', line 7 def middleware @middleware end |
Class Method Details
.keys ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/wayback/configurable.rb', line 12 def keys @keys ||= [ :endpoint, :endpoint_path, :connection_options, :identity_map, :middleware ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
28 29 30 31 |
# File 'lib/wayback/configurable.rb', line 28 def configure yield self self end |
#reset! ⇒ Object Also known as: setup
33 34 35 36 37 38 |
# File 'lib/wayback/configurable.rb', line 33 def reset! Wayback::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Wayback::Default.[key]) end self end |