Class: Skyfall::Jetstream::AccountMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/skyfall/jetstream/account_message.rb

Instance Attribute Summary

Attributes inherited from Message

#did, #json, #time_us, #type

Instance Method Summary collapse

Methods inherited from Message

new, #operations, #time

Constructor Details

#initialize(json) ⇒ AccountMessage

Returns a new instance of AccountMessage.

Raises:



6
7
8
9
# File 'lib/skyfall/jetstream/account_message.rb', line 6

def initialize(json)
  raise DecodeError.new("Missing event details") if json['account'].nil?
  super
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/skyfall/jetstream/account_message.rb', line 11

def active?
  @json['account']['active']
end

#statusObject



15
16
17
# File 'lib/skyfall/jetstream/account_message.rb', line 15

def status
  @json['account']['status']&.to_sym
end