Class: Firebase::Database

Inherits:
Object
  • Object
show all
Defined in:
lib/firebase-ruby/database.rb

Constant Summary collapse

FIREBASE_URL_TEMPLATE =
'https://%s.firebaseio.com/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDatabase

Returns a new instance of Database.



10
11
# File 'lib/firebase-ruby/database.rb', line 10

def initialize()
end

Instance Attribute Details

#authObject

Returns the value of attribute auth.



8
9
10
# File 'lib/firebase-ruby/database.rb', line 8

def auth
  @auth
end

Returns the value of attribute print.



8
9
10
# File 'lib/firebase-ruby/database.rb', line 8

def print
  @print
end

#shallowObject

Returns the value of attribute shallow.



8
9
10
# File 'lib/firebase-ruby/database.rb', line 8

def shallow
  @shallow
end

Instance Method Details

#delete(path) ⇒ Object



43
44
45
# File 'lib/firebase-ruby/database.rb', line 43

def delete(path)
  return operate(__method__, path)
end

#get(path) ⇒ Object



27
28
29
# File 'lib/firebase-ruby/database.rb', line 27

def get(path)
  return operate(__method__, path)
end

#patch(path, data) ⇒ Object



35
36
37
# File 'lib/firebase-ruby/database.rb', line 35

def patch(path, data)
  return operate(__method__, path, data)
end

#post(path, data) ⇒ Object



39
40
41
# File 'lib/firebase-ruby/database.rb', line 39

def post(path, data)
  return operate(__method__, path, data)
end

#project_idObject



21
22
23
24
25
# File 'lib/firebase-ruby/database.rb', line 21

def project_id
  return @project_id if @project_id
  return auth.project_id if auth
  return nil
end

#project_id=(id) ⇒ Object



17
18
19
# File 'lib/firebase-ruby/database.rb', line 17

def project_id=(id)
  @project_id = id
end

#put(path, data) ⇒ Object



31
32
33
# File 'lib/firebase-ruby/database.rb', line 31

def put(path, data)
  return operate(__method__, path, data)
end

#set_auth_with_key(json: nil, path: nil) ⇒ Object



13
14
15
# File 'lib/firebase-ruby/database.rb', line 13

def set_auth_with_key(json: nil, path: nil)
  @auth = Auth.new(json: json, path: path)
end