Class: Rubyoverflow::Revisions
- Defined in:
- lib/rubyoverflow/revisions.rb
Instance Attribute Summary collapse
-
#revisions ⇒ Object
readonly
Returns the value of attribute revisions.
Attributes inherited from PagedBase
#page, #pagesize, #query_parameters, #request_path, #total
Class Method Summary collapse
-
.retrieve_by_post(id, parameters = {}) ⇒ Object
Retrieves the post history of a set of post(s) by their id(s).
-
.retrieve_post_revision(id, revisionguid, parameters = {}) ⇒ Object
Retrieves a specific post revision by post id and revision guid.
Instance Method Summary collapse
-
#get_next_set ⇒ Object
Retrieves the next set of revisions using the same parameters used to retrieve the current set.
-
#initialize(hash, request_path = '') ⇒ Revisions
constructor
A new instance of Revisions.
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 = '') ⇒ Revisions
Returns a new instance of Revisions.
5 6 7 8 9 10 11 |
# File 'lib/rubyoverflow/revisions.rb', line 5 def initialize(hash, request_path = '') dash = RevisionsDash.new hash super(dash, request_path) @revisions = Array.new dash.revisions.each{|revisionHash| @revisions.push(Revision.new revisionHash)} end |
Instance Attribute Details
#revisions ⇒ Object (readonly)
Returns the value of attribute revisions.
3 4 5 |
# File 'lib/rubyoverflow/revisions.rb', line 3 def revisions @revisions end |
Class Method Details
.retrieve_by_post(id, parameters = {}) ⇒ Object
Retrieves the post history of a set of post(s) by their id(s)
id can be an int, string or an array of ints or strings
Maps to ‘revisions/id’
26 27 28 29 30 |
# File 'lib/rubyoverflow/revisions.rb', line 26 def retrieve_by_post(id, parameters = {}) id = convert_to_id_list(id) hash, url = request('/revisions/'+id.to_s, parameters) Revisions.new hash, url end |
.retrieve_post_revision(id, revisionguid, parameters = {}) ⇒ Object
Retrieves a specific post revision by post id and revision guid
id can be an int, string or an array of ints or strings
revisionguid must be a string in 8-4-4-4-12 format
Maps to ‘revisions/id’
39 40 41 42 43 |
# File 'lib/rubyoverflow/revisions.rb', line 39 def retrieve_post_revision(id, revisionguid, parameters = {}) id = convert_to_id_list(id) hash, url = request('/revisions/'+id.to_s + '/' + revisionguid, parameters) Revisions.new hash, url end |