Class: Weibo::Api::V2::Base
- Inherits:
-
Object
- Object
- Weibo::Api::V2::Base
- Extended by:
- Forwardable
- Defined in:
- lib/weibo_focus/api/v2/base.rb
Direct Known Subclasses
Account, Comments, Common, Favorites, Friendships, Location, Notification, Place, Register, Remind, Search, ShortUrl, Statuses, Suggestions, Tags, Trends, Users
Constant Summary collapse
- @@API_VERSION =
2
Instance Method Summary collapse
- #hashie(response) ⇒ Object
-
#initialize(access_token) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(access_token) ⇒ Base
Returns a new instance of Base.
15 16 17 |
# File 'lib/weibo_focus/api/v2/base.rb', line 15 def initialize(access_token) @access_token = access_token end |
Instance Method Details
#hashie(response) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/weibo_focus/api/v2/base.rb', line 19 def hashie(response) json_body = JSON.parse(response.body) if json_body.is_a? Array Array.new(json_body.count){|i| Hashie::Mash.new(json_body[i])} else Hashie::Mash.new json_body end end |