Conner Stephen McCabe
Conner Stephen McCabe

Reputation: 579

Access Instance Hash

How do I access the @attrs instance variable from outwith the class? This is an instance of the Twitter class, I need to know how to access the attrs instance hash variable?

#<Twitter::User:0x007f5c7c1f71d0 
    @attrs = {

Any help is appreciated, thanks.

Upvotes: 0

Views: 113

Answers (2)

Guilherme
Guilherme

Reputation: 1146

In this class you have a reader 'attrs' defined at: Twitter::Base, If you follow the inheritance chain of the Twitter::User, you will find that the User inherits from Twitter::Base. so you can use the 'twittah.attrs' method

Upvotes: 1

AndyV
AndyV

Reputation: 3741

twittah.instance_variable_get(:@attrs)

Upvotes: 1

Related Questions