lib/totter/client/timelines.rb in totter-0.3.1 vs lib/totter/client/timelines.rb in totter-0.3.2
- old
+ new
@@ -2,11 +2,11 @@
class Client
# Client methods for working with timelines.
module Timelines
# Default options sent with every timeline request unless otherwise specified.
DEFAULT_TIMELINE_OPTIONS = {
- limit: 20
+ :limit => 20
}
# Get recent decisions from the global timeline.
#
# @param options [Hash] Parameters for returning selected items
@@ -29,11 +29,11 @@
# @option options [String] :until A user_id/decision_id pair in the format '1,15' when paging backwards
# @return [Array] An array of `Hashie::Mash` objects representing decisions
# @example
# Totter.global_timeline(limit: 20, since: '1,15')
def hashtag_timeline(hashtag, options = DEFAULT_TIMELINE_OPTIONS)
- format_timeline_result get('timelines/global', options.merge({hashtag: hashtag}))
+ format_timeline_result get('timelines/global', options.merge({:hashtag => hashtag}))
end
# Get recent decisions from a sticker timeline
#
# @param sticker [String] The sticker to return
@@ -43,11 +43,11 @@
# @option options [String] :until A user_id/decision_id pair in the format '1,15' when paging backwards
# @return [Array]
# @example
# Totter.global_timeline(limit: 20, since: '1,15')
def sticker_timeline(sticker, options = DEFAULT_TIMELINE_OPTIONS)
- format_timeline_result get('timelines/global', options.merge({sticker: sticker}))
+ format_timeline_result get('timelines/global', options.merge({:sticker => sticker}))
end
# Search for published items
#
# @param query [String] The query to search for
@@ -57,11 +57,11 @@
# @option options [String] :until A user_id/decision_id pair in the format '1,15' when paging backwards
# @return [Array] An array of `Hashie::Mash` objects representing decisions
# @example
# Totter.global_timeline(limit: 20, since: '1,15')
def search_timeline(query, options = DEFAULT_TIMELINE_OPTIONS)
- format_timeline_result get('timelines/search', options.merge({query: query}))
+ format_timeline_result get('timelines/search', options.merge({:query => query}))
end
# Get recent decisions from the flagged-for-review timeline
#
# @param options [Hash] Parameters for returning selected items
@@ -104,13 +104,13 @@
# Totter.friends_timeline(4, limit: 20, since: '1,15')
def friends_timeline(user_id, options = DEFAULT_TIMELINE_OPTIONS)
format_timeline_result get("users/#{user_id}/timelines/friends", options)
end
- private
+ private
def format_timeline_result(http_result)
- Hashie::Mash.new(items: http_result.body, pusher_channel: http_result.headers['x-pusher-channel'])
+ Hashie::Mash.new(:items => http_result.body, :pusher_channel => http_result.headers['x-pusher-channel'])
end
end
end
end