Module: Wayback::Configurable

Extended by:
Forwardable
Included in:
Wayback, Client
Defined in:
lib/wayback/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connection_optionsObject

Returns the value of attribute connection_options.



7
8
9
# File 'lib/wayback/configurable.rb', line 7

def connection_options
  @connection_options
end

#endpointObject

Returns the value of attribute endpoint.



7
8
9
# File 'lib/wayback/configurable.rb', line 7

def endpoint
  @endpoint
end

#endpoint_pathObject

Returns the value of attribute endpoint_path.



7
8
9
# File 'lib/wayback/configurable.rb', line 7

def endpoint_path
  @endpoint_path
end

#identity_mapObject

Returns the value of attribute identity_map.



7
8
9
# File 'lib/wayback/configurable.rb', line 7

def identity_map
  @identity_map
end

#json_endpointObject

Returns the value of attribute json_endpoint.



7
8
9
# File 'lib/wayback/configurable.rb', line 7

def json_endpoint
  @json_endpoint
end

#json_endpoint_pathObject

Returns the value of attribute json_endpoint_path.



7
8
9
# File 'lib/wayback/configurable.rb', line 7

def json_endpoint_path
  @json_endpoint_path
end

#middlewareObject

Returns the value of attribute middleware.



7
8
9
# File 'lib/wayback/configurable.rb', line 7

def middleware
  @middleware
end

Class Method Details

.keysObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wayback/configurable.rb', line 12

def keys
  @keys ||= [
    :endpoint,
    :endpoint_path,
    :json_endpoint,
    :json_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

Yields:

  • (_self)

Yield Parameters:

Raises:



30
31
32
33
# File 'lib/wayback/configurable.rb', line 30

def configure
  yield self
  self
end

#reset!Object Also known as: setup



35
36
37
38
39
40
# File 'lib/wayback/configurable.rb', line 35

def reset!
  Wayback::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", Wayback::Default.options[key])
  end
  self
end