Module: Mastodon::REST::Utils
- Included in:
- Accounts, Apps, Media, Relationships, Statuses, Suggestions, Timelines
- Defined in:
- lib/mastodon/rest/utils.rb
Instance Method Summary collapse
- #perform_request(request_method, path, options = {}) ⇒ Object
- #perform_request_with_collection(request_method, path, options, klass) ⇒ Object
- #perform_request_with_object(request_method, path, options, klass) ⇒ Object
Instance Method Details
#perform_request(request_method, path, options = {}) ⇒ Object
9 10 11 |
# File 'lib/mastodon/rest/utils.rb', line 9 def perform_request(request_method, path, = {}) Mastodon::REST::Request.new(self, request_method, path, ).perform end |
#perform_request_with_collection(request_method, path, options, klass) ⇒ Object
26 27 28 29 |
# File 'lib/mastodon/rest/utils.rb', line 26 def perform_request_with_collection(request_method, path, , klass) response = perform_request(request_method, path, ) Mastodon::Collection.new(response, klass) end |
#perform_request_with_object(request_method, path, options, klass) ⇒ Object
17 18 19 20 |
# File 'lib/mastodon/rest/utils.rb', line 17 def perform_request_with_object(request_method, path, , klass) response = perform_request(request_method, path, ) klass.new(response) end |