module Croudia::Configurable

Attributes

access_token[W]
client_id[RW]
client_secret[W]
connection_options[RW]
endpoint[RW]
middleware[RW]

Public Class Methods

keys() click to toggle source
# File lib/croudia/configurable.rb, line 9
def keys
  @keys ||= [
    :endpoint,
    :connection_options,
    :middleware,
    :client_id,
    :client_secret,
    :access_token,
  ]
end

Public Instance Methods

configure() { |self| ... } click to toggle source
# File lib/croudia/configurable.rb, line 21
def configure
  yield self
  self
end
options() click to toggle source
# File lib/croudia/configurable.rb, line 33
def options
  Hash[Croudia::Configurable.keys.map do |key|
    [key, instance_variable_get(:"@#{key}")]
  end]
end
reset!() click to toggle source
# File lib/croudia/configurable.rb, line 26
def reset!
  Croudia::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", Croudia::Default.options[key])
  end
end
Also aliased as: setup
setup()
Alias for: reset!