Class: LinkedIn::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/linkedin/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(attributes = {}) ⇒ Base
5
6
7
|
# File 'lib/linkedin/base.rb', line 5
def initialize(attributes={})
@attributes = Hashie::Mash.new attributes
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
9
10
11
12
|
# File 'lib/linkedin/base.rb', line 9
def method_missing(method, *args, &block)
return @attributes.send(method, *args, &block) if @attributes.respond_to?(method)
super
end
|
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3
4
5
|
# File 'lib/linkedin/base.rb', line 3
def attributes
@attributes
end
|
Class Method Details
.client ⇒ Object
23
24
25
|
# File 'lib/linkedin/base.rb', line 23
def self.client
@@client ||= self.reset_client
end
|
.reset_client ⇒ Object
27
28
29
|
# File 'lib/linkedin/base.rb', line 27
def self.reset_client
@@client = LinkedIn.new
end
|
Instance Method Details
#client ⇒ Object
19
20
21
|
# File 'lib/linkedin/base.rb', line 19
def client
Base.client
end
|
#respond_to?(method, include_all = false) ⇒ Boolean
14
15
16
17
|
# File 'lib/linkedin/base.rb', line 14
def respond_to?(method, include_all=false)
return true if @attributes.respond_to method, include_all
super
end
|