lib/whatser/client.rb in whatser-0.2.0 vs lib/whatser/client.rb in whatser-0.3.0
- old
+ new
@@ -11,10 +11,11 @@
yield self
true
end
end
+ attr_accessor :logger
attr_accessor *Whatser::Configuration::VALID_OPTIONS_KEYS
def initialize(options={})
Whatser::Configuration::VALID_OPTIONS_KEYS.each do |key|
if options[key].blank?
send("#{key}=", self.class.send(key) )
@@ -47,8 +48,13 @@
include Whatser::Http
include Whatser::OAuth
def authorized?
!oauth_token.blank?
+ end
+
+ def log(msg,level=:info)
+ return if logger.blank?
+ logger.send(level, msg)
end
end
end
\ No newline at end of file