Sha256: a77048942c43891778c22a2d6b0406ad58619419f98c81f3cfb6377ef521be22

Contents?: true

Size: 618 Bytes

Versions: 16

Compression:

Stored size: 618 Bytes

Contents

module LinkedIn
  class Base
    attr_reader :attributes

    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

    def respond_to?(method, include_all=false)
      return true if @attributes.respond_to method, include_all
      super
    end

    def client
      Base.client
    end

    def self.client
      @@client ||= self.reset_client
    end

    def self.reset_client
      @@client = LinkedIn.new
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
linkedin2-0.0.19 lib/linkedin/base.rb
linkedin2-0.0.18 lib/linkedin/base.rb
linkedin2-0.0.17 lib/linkedin/base.rb
linkedin2-0.0.16 lib/linkedin/base.rb
linkedin2-0.0.15 lib/linkedin/base.rb
linkedin2-0.0.14 lib/linkedin/base.rb
linkedin2-0.0.13 lib/linkedin/base.rb
linkedin2-0.0.12 lib/linkedin/base.rb
linkedin2-0.0.11 lib/linkedin/base.rb
linkedin2-0.0.10 lib/linkedin/base.rb
linkedin2-0.0.9 lib/linkedin/base.rb
linkedin2-0.0.8 lib/linkedin/base.rb
linkedin2-0.0.7 lib/linkedin/base.rb
linkedin2-0.0.6 lib/linkedin/base.rb
linkedin2-0.0.5 lib/linkedin/base.rb
linkedin2-0.0.4 lib/linkedin/base.rb