Skip to content

Commit

Permalink
Make #attrs call methods if they exist
Browse files Browse the repository at this point in the history
Closes #361.
  • Loading branch information
sferik committed Mar 8, 2013
1 parent 97a757c commit ff4f2da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/twitter/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def [](method)
#
# @return [Hash]
def attrs
@attrs
@attrs.inject({}) do |attrs, (key, value)|
attrs.merge!(key => respond_to?(key) ? send(key) : value)
end
end
alias to_hash attrs

Expand Down

0 comments on commit ff4f2da

Please sign in to comment.