Class: Rubyoverflow::PostTimelineEvents

Inherits:
PagedBase show all
Defined in:
lib/rubyoverflow/postTimelineEvents.rb

Instance Attribute Summary collapse

Attributes inherited from PagedBase

#page, #pagesize, #query_parameters, #request_path, #total

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PagedBase

#next_page_parameters, #perform_next_page_request

Methods inherited from Base

change_end_point, client, convert_if_array, convert_to_id_list, #find_parse_querystring, request, #request

Constructor Details

#initialize(hash, request_path = '') ⇒ PostTimelineEvents

Returns a new instance of PostTimelineEvents.



5
6
7
8
9
10
11
# File 'lib/rubyoverflow/postTimelineEvents.rb', line 5

def initialize(hash, request_path = '')
  dash = PostTimelineEventsDash.new hash
  super(dash, request_path)

  @post_timelines = Array.new
  dash.post_timelines.each {|postTimeHash| @post_timelines.push(PostTimelineEvent.new postTimeHash)}
end

Instance Attribute Details

#post_timelinesObject (readonly)

Returns the value of attribute post_timelines.



3
4
5
# File 'lib/rubyoverflow/postTimelineEvents.rb', line 3

def post_timelines
  @post_timelines
end

Class Method Details

.retrieve_by_question(id, parameters = {}) ⇒ Object

Retrieve a set of PostTimelineEvent for a set of question(s) by their id(s)

id can be an int, string, or an array of ints or strings

Maps to ‘questions/id/timeline’



26
27
28
29
30
31
# File 'lib/rubyoverflow/postTimelineEvents.rb', line 26

def retrieve_by_question(id, parameters = {})
  id = convert_to_id_list(id)

  hash, url = request('questions/' + id.to_s + '/timeline', parameters)
  PostTimelineEvents.new hash, url
end

Instance Method Details

#get_next_setObject

Retrieves the next set of PostTimelineEvents using the same parameters used to retrieve the current set



14
15
16
17
# File 'lib/rubyoverflow/postTimelineEvents.rb', line 14

def get_next_set
  hash,url = perform_next_page_request
  PostTimelineEvents.new hash,url
end