lib/uatu/configuration.rb in uatu-marvel-0.0.2 vs lib/uatu/configuration.rb in uatu-marvel-0.1.0

- old
+ new

@@ -1,29 +1,27 @@ module Uatu module Configuration - VALID_CONFIG_KEYS = [:base_url, :public_key, :private_key] + VALID_CONFIG_KEYS = [:public_key, :private_key] - BASE_URL = "http://gateway.marvel.com" PUBLIC_KEY = ENV["MARVEL_PUBLIC_KEY"] PRIVATE_KEY = ENV["MARVEL_PRIVATE_KEY"] - + attr_accessor *VALID_CONFIG_KEYS def self.extended(base) base.reset end def configure yield self end - def options + def credentials Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ] end def reset - self.base_url = BASE_URL self.public_key = PUBLIC_KEY self.private_key = PRIVATE_KEY end end \ No newline at end of file