Class: Cadenya::Types::WidgetSessionInfo
- Inherits:
-
Object
- Object
- Cadenya::Types::WidgetSessionInfo
- Defined in:
- lib/cadenya/types.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#last_active_at ⇒ Object
readonly
Returns the value of attribute last_active_at.
-
#message_count ⇒ Object
readonly
Returns the value of attribute message_count.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#tenant ⇒ Object
readonly
Returns the value of attribute tenant.
-
#widget ⇒ Object
readonly
Returns the value of attribute widget.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(widget: nil, agent: nil, tenant: nil, subject: nil, host: nil, message_count: nil, last_active_at: nil) ⇒ WidgetSessionInfo
constructor
A new instance of WidgetSessionInfo.
- #to_h ⇒ Object
Constructor Details
#initialize(widget: nil, agent: nil, tenant: nil, subject: nil, host: nil, message_count: nil, last_active_at: nil) ⇒ WidgetSessionInfo
Returns a new instance of WidgetSessionInfo.
7373 7374 7375 7376 7377 7378 7379 7380 7381 |
# File 'lib/cadenya/types.rb', line 7373 def initialize(widget: nil, agent: nil, tenant: nil, subject: nil, host: nil, message_count: nil, last_active_at: nil) @widget = @agent = agent @tenant = tenant @subject = subject @host = host @message_count = @last_active_at = last_active_at end |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
7371 7372 7373 |
# File 'lib/cadenya/types.rb', line 7371 def agent @agent end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
7371 7372 7373 |
# File 'lib/cadenya/types.rb', line 7371 def host @host end |
#last_active_at ⇒ Object (readonly)
Returns the value of attribute last_active_at.
7371 7372 7373 |
# File 'lib/cadenya/types.rb', line 7371 def last_active_at @last_active_at end |
#message_count ⇒ Object (readonly)
Returns the value of attribute message_count.
7371 7372 7373 |
# File 'lib/cadenya/types.rb', line 7371 def @message_count end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
7371 7372 7373 |
# File 'lib/cadenya/types.rb', line 7371 def subject @subject end |
#tenant ⇒ Object (readonly)
Returns the value of attribute tenant.
7371 7372 7373 |
# File 'lib/cadenya/types.rb', line 7371 def tenant @tenant end |
#widget ⇒ Object (readonly)
Returns the value of attribute widget.
7371 7372 7373 |
# File 'lib/cadenya/types.rb', line 7371 def @widget end |
Class Method Details
.from_json(data) ⇒ Object
7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 |
# File 'lib/cadenya/types.rb', line 7383 def self.from_json(data) new( widget: data["widget"].nil? ? nil : Types::BareMetadata.from_json(data["widget"]), agent: data["agent"].nil? ? nil : Types::BareMetadata.from_json(data["agent"]), tenant: data["tenant"].nil? ? nil : Types::TenantReference.from_json(data["tenant"]), subject: data["subject"].nil? ? nil : Types::SubjectReference.from_json(data["subject"]), host: data["host"], message_count: data["messageCount"], last_active_at: data["lastActiveAt"].nil? ? nil : Time.iso8601(data["lastActiveAt"]), ) end |
Instance Method Details
#to_h ⇒ Object
7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 |
# File 'lib/cadenya/types.rb', line 7395 def to_h { widget: Util.plain(@widget), agent: Util.plain(@agent), tenant: Util.plain(@tenant), subject: Util.plain(@subject), host: Util.plain(@host), message_count: Util.plain(@message_count), last_active_at: Util.plain(@last_active_at), }.reject { |_k, v| v.nil? } end |