Class: Omega::Client::User

Inherits:
Object show all
Includes:
Trackable
Defined in:
lib/omega/client/entities/user.rb

Overview

Omega client Users::User tracker

Instance Attribute Summary

Attributes included from Trackable

#entity, #event_handlers

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Trackable

#clear_handlers, #clear_handlers_for, #handle, #handles?, included, #method_missing, #node, node, #raise_event, #refresh

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Omega::Client::Trackable

Class Method Details

.login(user_id, password) ⇒ Object


29
30
31
32
33
34
# File 'lib/omega/client/entities/user.rb', line 29

def self.(user_id, password)
  user = Users::User.new(:id => user_id, :password => password)
  session = node.invoke('users::login', user)
  node.rjr_node.message_headers['session_id'] = session.id
  nil
end

Instance Method Details

#shipsObject

TODO how to detect & retrieve newly created ships & stations from the server?


21
22
23
# File 'lib/omega/client/entities/user.rb', line 21

def ships
  @ships    ||= Omega::Client::Ship.owned_by(self.id)
end

#stationsObject


25
26
27
# File 'lib/omega/client/entities/user.rb', line 25

def stations
  @stations ||= Omega::Client::Station.owned_by(self.id)
end