0

i am using oauth to create an oauth object which looks like this -

>> y @oauth
--- !ruby/object:LinkedIn::Oauth 
api_key: ggrgergrgrgrg
api_secret: 
consumer: &id001 !ruby/object:OAuth::Consumer 
key: ggergergrgrg
options: 
   blah blah

I can access

@oauth.consumer but not @oauth.api_key

Any ideas ?

Thanks, Alex

2
  • 2
    what do you mean by can't access, is there a NoMethodError? Commented Nov 10, 2010 at 10:32
  • maybe the reader method doesn't exists on LinkedIn::Oauth, check the code of this class Commented Nov 10, 2010 at 12:29

1 Answer 1

1

Is it a private method? Try accessing it with @oauth.send(:api_key)

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your responses! it was a private method. Does anyone have a good resource for learning about ruby objects ?
There's a great book called "Metaprogramming Ruby: Program Like the Ruby Pros" that I recently read. It discusses this exact topic. A little advanced, but if you're interested, definitely worth a read.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.