Class: Arcp::Session::Pong

Inherits:
Data
  • Object
show all
Defined in:
lib/arcp/session/pong.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ping_nonceObject (readonly)

Returns the value of attribute ping_nonce

Returns:

  • (Object)

    the current value of ping_nonce



5
6
7
# File 'lib/arcp/session/pong.rb', line 5

def ping_nonce
  @ping_nonce
end

#received_atObject (readonly)

Returns the value of attribute received_at

Returns:

  • (Object)

    the current value of received_at



5
6
7
# File 'lib/arcp/session/pong.rb', line 5

def received_at
  @received_at
end

Class Method Details

.from_h(h) ⇒ Object



6
7
8
9
# File 'lib/arcp/session/pong.rb', line 6

def self.from_h(h)
  h = h.transform_keys(&:to_s)
  new(ping_nonce: h.fetch('ping_nonce'), received_at: h.fetch('received_at'))
end

Instance Method Details

#to_hObject



11
# File 'lib/arcp/session/pong.rb', line 11

def to_h = { 'ping_nonce' => ping_nonce, 'received_at' => received_at }