Class: Arcp::Session::Welcome
- Inherits:
-
Data
- Object
- Data
- Arcp::Session::Welcome
- Defined in:
- lib/arcp/session/welcome.rb
Instance Attribute Summary collapse
-
#capabilities ⇒ Object
readonly
Returns the value of attribute capabilities.
-
#heartbeat_interval_sec ⇒ Object
readonly
Returns the value of attribute heartbeat_interval_sec.
-
#resume_token ⇒ Object
readonly
Returns the value of attribute resume_token.
-
#resume_window_sec ⇒ Object
readonly
Returns the value of attribute resume_window_sec.
-
#runtime_name ⇒ Object
readonly
Returns the value of attribute runtime_name.
-
#runtime_version ⇒ Object
readonly
Returns the value of attribute runtime_version.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#capabilities ⇒ Object (readonly)
Returns the value of attribute capabilities
5 6 7 |
# File 'lib/arcp/session/welcome.rb', line 5 def capabilities @capabilities end |
#heartbeat_interval_sec ⇒ Object (readonly)
Returns the value of attribute heartbeat_interval_sec
5 6 7 |
# File 'lib/arcp/session/welcome.rb', line 5 def heartbeat_interval_sec @heartbeat_interval_sec end |
#resume_token ⇒ Object (readonly)
Returns the value of attribute resume_token
5 6 7 |
# File 'lib/arcp/session/welcome.rb', line 5 def resume_token @resume_token end |
#resume_window_sec ⇒ Object (readonly)
Returns the value of attribute resume_window_sec
5 6 7 |
# File 'lib/arcp/session/welcome.rb', line 5 def resume_window_sec @resume_window_sec end |
#runtime_name ⇒ Object (readonly)
Returns the value of attribute runtime_name
5 6 7 |
# File 'lib/arcp/session/welcome.rb', line 5 def runtime_name @runtime_name end |
#runtime_version ⇒ Object (readonly)
Returns the value of attribute runtime_version
5 6 7 |
# File 'lib/arcp/session/welcome.rb', line 5 def runtime_version @runtime_version end |
Class Method Details
.from_h(h) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/arcp/session/welcome.rb', line 9 def self.from_h(h) h = h.transform_keys(&:to_s) caps = h['capabilities'] || {} new( runtime_name: h['runtime_name'], runtime_version: h['runtime_version'], capabilities: CapabilitySet.new( features: Array(caps['features']).freeze, encodings: Array(caps['encodings']).freeze, agents: caps['agents'] ? AgentInventory.from_array(caps['agents']) : nil ), heartbeat_interval_sec: h['heartbeat_interval_sec'], resume_token: h['resume_token'], resume_window_sec: h['resume_window_sec'] ) end |
Instance Method Details
#to_h ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/arcp/session/welcome.rb', line 26 def to_h { 'runtime_name' => runtime_name, 'runtime_version' => runtime_version, 'capabilities' => capabilities.to_h, 'heartbeat_interval_sec' => heartbeat_interval_sec, 'resume_token' => resume_token, 'resume_window_sec' => resume_window_sec } end |