Class: Vines::Cluster::UserProxy

Inherits:
User
  • Object
show all
Defined in:
lib/vines/cluster.rb

Overview

Proxy User#update_from calls to remote cluster nodes over redis pubsub channels.

Instance Attribute Summary

Attributes inherited from User

#jid, #name, #password, #roster

Instance Method Summary collapse

Methods inherited from User

#<=>, #add_subscription_from, #contact, #contact?, #hash, #remove_contact, #remove_subscription_from, #remove_subscription_to, #request_subscription, #subscribed_from?, #subscribed_from_contacts, #subscribed_to?, #subscribed_to_contacts, #to_roster_xml

Constructor Details

#initialize(cluster, session) ⇒ UserProxy

Returns a new instance of UserProxy.



236
237
238
239
# File 'lib/vines/cluster.rb', line 236

def initialize(cluster, session)
  super(jid: session['jid'])
  @cluster, @node = cluster, session['node']
end

Instance Method Details

#update_from(user) ⇒ Object



241
242
243
# File 'lib/vines/cluster.rb', line 241

def update_from(user)
  @cluster.update_user(@jid.bare, @node)
end