Class: Firebase::Database
- Inherits:
-
Object
- Object
- Firebase::Database
- Defined in:
- lib/firebase-ruby/database.rb
Constant Summary collapse
- FIREBASE_URL_TEMPLATE =
'https://%s.firebaseio.com/'
Instance Attribute Summary collapse
-
#auth ⇒ Object
Returns the value of attribute auth.
-
#print ⇒ Object
Returns the value of attribute print.
-
#shallow ⇒ Object
Returns the value of attribute shallow.
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #get(path) ⇒ Object
-
#initialize ⇒ Database
constructor
A new instance of Database.
- #patch(path, data) ⇒ Object
- #post(path, data) ⇒ Object
- #project_id ⇒ Object
- #project_id=(id) ⇒ Object
- #put(path, data) ⇒ Object
- #set_auth_with_key(json: nil, path: nil) ⇒ Object
Constructor Details
#initialize ⇒ Database
Returns a new instance of Database.
10 11 |
# File 'lib/firebase-ruby/database.rb', line 10 def initialize() end |
Instance Attribute Details
#auth ⇒ Object
Returns the value of attribute auth.
8 9 10 |
# File 'lib/firebase-ruby/database.rb', line 8 def auth @auth end |
#print ⇒ Object
Returns the value of attribute print.
8 9 10 |
# File 'lib/firebase-ruby/database.rb', line 8 def print @print end |
#shallow ⇒ Object
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_id ⇒ Object
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 |