lib/linkedin/base.rb in linkedin2-0.0.3 vs lib/linkedin/base.rb in linkedin2-0.0.4
- old
+ new
@@ -4,11 +4,10 @@
def initialize(attributes={})
@attributes = Hashie::Mash.new attributes
end
-
def method_missing(method, *args, &block)
return @attributes.send(method, *args, &block) if @attributes.respond_to?(method)
super
end
@@ -16,13 +15,17 @@
return true if @attributes.respond_to method, include_all
super
end
def client
- LinkedIn.new
+ Base.client
end
def self.client
- LinkedIn.new
+ @@client ||= self.reset_client
+ end
+
+ def self.reset_client
+ @@client = LinkedIn.new
end
end
end