Class: Socialshare::Linkdin
- Inherits:
-
Object
- Object
- Socialshare::Linkdin
- Defined in:
- lib/socialshare/linkdin.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#linkdin_user ⇒ Object
Returns the value of attribute linkdin_user.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
-
#user_secret ⇒ Object
Returns the value of attribute user_secret.
-
#user_token ⇒ Object
Returns the value of attribute user_token.
Instance Method Summary collapse
- #get_linkedin_profile(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Linkdin
constructor
A new instance of Linkdin.
- #post(text) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Linkdin
Returns a new instance of Linkdin.
7 8 9 10 11 12 13 |
# File 'lib/socialshare/linkdin.rb', line 7 def initialize( = {}) @api_key = [:api_key] @secret_key = [:secret_key] @user_token = [:user_token] @user_secret = [:user_secret] @linkdin_user = get_linkedin_user() end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/socialshare/linkdin.rb', line 5 def api_key @api_key end |
#linkdin_user ⇒ Object
Returns the value of attribute linkdin_user.
5 6 7 |
# File 'lib/socialshare/linkdin.rb', line 5 def linkdin_user @linkdin_user end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
5 6 7 |
# File 'lib/socialshare/linkdin.rb', line 5 def secret_key @secret_key end |
#user_secret ⇒ Object
Returns the value of attribute user_secret.
5 6 7 |
# File 'lib/socialshare/linkdin.rb', line 5 def user_secret @user_secret end |
#user_token ⇒ Object
Returns the value of attribute user_token.
5 6 7 |
# File 'lib/socialshare/linkdin.rb', line 5 def user_token @user_token end |
Instance Method Details
#get_linkedin_profile(options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/socialshare/linkdin.rb', line 23 def get_linkedin_profile( = {}) begin if [:id] self.linkdin_user.profile(:id => [:id]) else self.linkdin_user.profile end rescue Exception => e return e end end |
#post(text) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/socialshare/linkdin.rb', line 15 def post(text) begin self.linkdin_user.add_share(:comment => text) rescue Exception => e return e end end |