Class: Skyfall::Firehose::AccountMessage
- Defined in:
- lib/skyfall/firehose/account_message.rb
Overview
Firehose message sent when the status of an account changes. This can be:
-
an account being created, sending its initial state (should be active)
-
an account being deactivated or suspended
-
an account being restored back to an active state from deactivation/suspension
-
an account being deleted (the status returning
:deleted)
Instance Attribute Summary collapse
-
#status ⇒ Symbol?
readonly
For inactive accounts, specifies the exact state; nil for active accounts.
Attributes inherited from Message
#data_object, #did, #seq, #type, #type_object
Instance Method Summary collapse
-
#active? ⇒ Boolean
True if the account is active, false if it’s deactivated/suspended etc.
-
#initialize(type_object, data_object) ⇒ AccountMessage
constructor
A new instance of AccountMessage.
Methods inherited from Message
#inspect, new, #operations, #time, #unknown?
Constructor Details
#initialize(type_object, data_object) ⇒ AccountMessage
Returns a new instance of AccountMessage.
25 26 27 28 29 30 31 |
# File 'lib/skyfall/firehose/account_message.rb', line 25 def initialize(type_object, data_object) super check_if_not_nil 'seq', 'did', 'time', 'active' @active = @data_object['active'] @status = @data_object['status']&.to_sym end |
Instance Attribute Details
#status ⇒ Symbol? (readonly)
Returns for inactive accounts, specifies the exact state; nil for active accounts.
39 40 41 |
# File 'lib/skyfall/firehose/account_message.rb', line 39 def status @status end |
Instance Method Details
#active? ⇒ Boolean
Returns true if the account is active, false if it’s deactivated/suspended etc.
34 35 36 |
# File 'lib/skyfall/firehose/account_message.rb', line 34 def active? @active end |