Class: Caboodle::LinkedinAPI

Inherits:
Weary::Base
  • Object
show all
Defined in:
lib/caboodle/kits/linkedin/linkedin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLinkedinAPI

Returns a new instance of LinkedinAPI.



7
8
9
10
11
# File 'lib/caboodle/kits/linkedin/linkedin.rb', line 7

def initialize
  @full = Caboodle.scrape(Site.linkedin_profile_url)
  @full.css('.showhide-link').each{|a| @full.delete(a)}
  @full = @full.css("#main").to_html.gsub("#{Site.linkedin_full_name}’s ","")
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



12
13
14
# File 'lib/caboodle/kits/linkedin/linkedin.rb', line 12

def method_missing(method_name)
  @data.send(method_name.to_sym)
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



4
5
6
# File 'lib/caboodle/kits/linkedin/linkedin.rb', line 4

def data
  @data
end

#fullObject

Returns the value of attribute full.



5
6
7
# File 'lib/caboodle/kits/linkedin/linkedin.rb', line 5

def full
  @full
end