Class: Firebase::Admin::App
- Inherits:
-
Object
- Object
- Firebase::Admin::App
- Defined in:
- lib/firebase/admin/app.rb,
lib/firebase/admin/auth/client.rb,
lib/firebase/admin/messaging/client.rb
Overview
An App holds configuration and state common to all Firebase services that are exposed from the SDK.
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#service_account_id ⇒ Object
readonly
Returns the value of attribute service_account_id.
Instance Method Summary collapse
-
#auth ⇒ Firebase::Admin::Auth::Client
Gets the auth client for this App.
-
#initialize(credentials: nil, config: nil) ⇒ App
constructor
Constructs a new App.
-
#messaging ⇒ Firebase::Admin::Messaging::Client
Gets the Firebase Cloud Messaging client for this App.
Constructor Details
#initialize(credentials: nil, config: nil) ⇒ App
Constructs a new App.
20 21 22 23 24 25 |
# File 'lib/firebase/admin/app.rb', line 20 def initialize(credentials: nil, config: nil) @config = config || Config.from_env @credentials = credentials || Credentials.from_default @service_account_id = @config.service_account_id @project_id = @config.project_id || @credentials.project_id end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
12 13 14 |
# File 'lib/firebase/admin/app.rb', line 12 def credentials @credentials end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
12 13 14 |
# File 'lib/firebase/admin/app.rb', line 12 def project_id @project_id end |
#service_account_id ⇒ Object (readonly)
Returns the value of attribute service_account_id.
12 13 14 |
# File 'lib/firebase/admin/app.rb', line 12 def service_account_id @service_account_id end |
Instance Method Details
#auth ⇒ Firebase::Admin::Auth::Client
Gets the auth client for this App.
119 120 121 |
# File 'lib/firebase/admin/auth/client.rb', line 119 def auth @auth_client ||= Auth::Client.new(self) end |
#messaging ⇒ Firebase::Admin::Messaging::Client
Gets the Firebase Cloud Messaging client for this App.
201 202 203 |
# File 'lib/firebase/admin/messaging/client.rb', line 201 def messaging @messaging_client ||= Messaging::Client.new(self) end |