Class: A2A::PushNotification::Config
- Inherits:
-
Object
- Object
- A2A::PushNotification::Config
- Defined in:
- lib/a2a/push_notification/config.rb
Instance Attribute Summary collapse
-
#authentication ⇒ Object
readonly
Returns the value of attribute authentication.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
-
#tenant ⇒ Object
readonly
Returns the value of attribute tenant.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url:, **kwargs) ⇒ Config
constructor
A new instance of Config.
- #to_h ⇒ Object
Constructor Details
#initialize(url:, **kwargs) ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 14 15 |
# File 'lib/a2a/push_notification/config.rb', line 8 def initialize(url:, **kwargs) @url = url @id = kwargs[:id] @token = kwargs[:token] @tenant = kwargs[:tenant] @task_id = kwargs[:task_id] @authentication = kwargs[:authentication] end |
Instance Attribute Details
#authentication ⇒ Object (readonly)
Returns the value of attribute authentication.
6 7 8 |
# File 'lib/a2a/push_notification/config.rb', line 6 def authentication @authentication end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/a2a/push_notification/config.rb', line 6 def id @id end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
6 7 8 |
# File 'lib/a2a/push_notification/config.rb', line 6 def task_id @task_id end |
#tenant ⇒ Object (readonly)
Returns the value of attribute tenant.
6 7 8 |
# File 'lib/a2a/push_notification/config.rb', line 6 def tenant @tenant end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
6 7 8 |
# File 'lib/a2a/push_notification/config.rb', line 6 def token @token end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/a2a/push_notification/config.rb', line 6 def url @url end |
Class Method Details
.from_h(hash) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/a2a/push_notification/config.rb', line 17 def self.from_h(hash) new( url: hash.fetch("url"), id: hash["id"], token: hash["token"], tenant: hash["tenant"], task_id: hash["taskId"], authentication: hash["authentication"] && AuthenticationInfo.from_h(hash["authentication"]) ) end |
Instance Method Details
#to_h ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/a2a/push_notification/config.rb', line 28 def to_h { "url" => url, "id" => id, "token" => token, "tenant" => tenant, "taskId" => task_id, "authentication" => authentication }.compact end |