lib/ayadn/api.rb in ayadn-2.1 vs lib/ayadn/api.rb in ayadn-3.0
- old
+ new
@@ -34,12 +34,17 @@
options = paginate options, 'explore:replies'
get_explore(:conversations, options)
end
def get_explore(explore, options)
- url = Endpoints.new.trending(options) if explore == :trending
- url = Endpoints.new.photos(options) if explore == :photos
- url = Endpoints.new.conversations(options) if explore == :conversations
+ url = case explore
+ when :trending
+ Endpoints.new.trending(options)
+ when :photos
+ Endpoints.new.photos(options)
+ when :conversations
+ Endpoints.new.conversations(options)
+ end
get_parsed_response(url)
end
def get_mentions(username, options)
get_parsed_response(Endpoints.new.mentions(username, options))