accessing ruby object attribute
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
Is it a private method? Try accessing it with @oauth.send(:api_key)
精彩评论