Class: Firebase::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/firebase/request.rb

Instance Method Summary collapse

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, query_options)
  process(:delete, path, nil, query_options)
end

#get(path, query_options) ⇒ Object



11
12
13
# File 'lib/firebase/request.rb', line 11

def get(path, query_options)
  process(:get, path, nil, query_options)
end

#patch(path, value, query_options) ⇒ Object



27
28
29
# File 'lib/firebase/request.rb', line 27

def patch(path, value, query_options)
  process(:patch, path, value.to_json, query_options)
end

#post(path, value, query_options) ⇒ Object



19
20
21
# File 'lib/firebase/request.rb', line 19

def post(path, value, query_options)
  process(:post, path, value.to_json, query_options)
end

#put(path, value, query_options) ⇒ Object



15
16
17
# File 'lib/firebase/request.rb', line 15

def put(path, value, query_options)
  process(:put, path, value.to_json, query_options)
end