lib/meducation_sdk/configuration.rb in meducation_sdk-0.2.0 vs lib/meducation_sdk/configuration.rb in meducation_sdk-0.3.0

- old
+ new

@@ -4,20 +4,28 @@ class MeducationSDKConfigurationError < MeducationSDKError end class Configuration - SETTINGS = [ - :logger, :access_id, :secret_key, :endpoint - ] + SETTINGS = [ :logger ] attr_writer *SETTINGS def initialize - Filum.config do |config| - config.logfile = "./log/loquor.log" + Filum.config.logfile = "./log/loquor.log" + Loquor.config.endpoint = "http://www.meducation.net/system" + self.logger = Filum.logger + end + + [:access_id, :secret_key, :endpoint].each do |setting| + define_method "#{setting}=" do |val| + Loquor.config.send("#{setting}=", val) end - logger = Filum.logger + end + + def logger=(val) + @logger = val + Loquor.config.logger = val end SETTINGS.each do |setting| define_method setting do get_or_raise(setting)