Class: Firebase::Request
- Inherits:
-
Object
- Object
- Firebase::Request
- Defined in:
- lib/firebase/request.rb
Instance Method Summary collapse
- #delete(path, query_options) ⇒ Object
- #get(path, query_options) ⇒ Object
-
#initialize(base_uri) ⇒ Request
constructor
A new instance of Request.
- #patch(path, value, query_options) ⇒ Object
- #post(path, value, query_options) ⇒ Object
- #put(path, value, query_options) ⇒ Object
Constructor Details
#initialize(base_uri) ⇒ Request
Returns a new instance of Request.
6 7 8 9 |
# File 'lib/firebase/request.rb', line 6 def initialize(base_uri) @client = HTTPClient.new(base_url: base_uri) @client.default_header['Content-Type'] = 'application/json' end |
Instance Method Details
#delete(path, query_options) ⇒ Object
23 24 25 |
# File 'lib/firebase/request.rb', line 23 def delete(path, ) process(:delete, path, nil, ) end |
#get(path, query_options) ⇒ Object
11 12 13 |
# File 'lib/firebase/request.rb', line 11 def get(path, ) process(:get, path, nil, ) end |
#patch(path, value, query_options) ⇒ Object
27 28 29 |
# File 'lib/firebase/request.rb', line 27 def patch(path, value, ) process(:patch, path, value.to_json, ) end |
#post(path, value, query_options) ⇒ Object
19 20 21 |
# File 'lib/firebase/request.rb', line 19 def post(path, value, ) process(:post, path, value.to_json, ) end |
#put(path, value, query_options) ⇒ Object
15 16 17 |
# File 'lib/firebase/request.rb', line 15 def put(path, value, ) process(:put, path, value.to_json, ) end |