Class: Arisaid::Bots

Inherits:
Object
  • Object
show all
Includes:
Client, Syncable, Userable
Defined in:
lib/arisaid/bots.rb

Instance Attribute Summary

Attributes included from Syncable

#local_file

Attributes included from Userable

#bots, #guests, #users

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Syncable

#apply, #initialize, #local, #local_by_file, #local_by_stdin, #local_file_path, #merge_users, #remote, #same?, #save, #show

Methods included from Userable

#bots!, #guests!, #users!

Methods included from Client

#client, #client!

Class Method Details

.bot_valid_attributesObject



16
17
18
19
20
# File 'lib/arisaid/bots.rb', line 16

def bot_valid_attributes
  %i(
    name
  )
end

Instance Method Details

#remote!Object



7
8
9
10
11
12
13
# File 'lib/arisaid/bots.rb', line 7

def remote!
  @remote = bots!.map { |user|
    hash = user.to_h.slice(*self.class.bot_valid_attributes)
    hash[:real] = user.real_name if user.real_name && !user.real_name.empty?
    hash.stringify_keys
  }
end