Class: LinkedIn::Base
- Inherits:
-
Object
- Object
- LinkedIn::Base
- Defined in:
- lib/linkedin/base.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
- #client ⇒ Object
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to?(method, include_all = false) ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of 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 (readonly)
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 |
Instance Method Details
#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 |