Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make #attrs call methods if they exist

Closes #361.
  • Loading branch information...
commit ff4f2daccd1acdfddcea7139d4dd6490b55129db 1 parent 97a757c
@sferik authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/twitter/base.rb
View
4 lib/twitter/base.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.