Module: Missions::RJR

Includes:
Missions, Omega, Omega::Server::DSL
Defined in:
lib/missions/rjr/get.rb,
lib/missions/rjr/init.rb,
lib/missions/rjr/hooks.rb,
lib/missions/rjr/state.rb,
lib/missions/rjr/assign.rb,
lib/missions/rjr/events.rb,
lib/missions/rjr/create.rb,
lib/missions/rjr/inspect.rb

Overview

TODO

  • list of event ids and handle to event by id

Constant Summary collapse

GET_METHODS =
{ :get_missions => get_missions  }
PRIVILEGES =

Missions::RJR data

[['view',   'users'],
['modify', 'user_attributes'],
['view',   'users_events'],
['view',   'cosmos_entities'],
['modify', 'cosmos_entities'],
['create', 'cosmos_entities'],
['view',   'manufactured_entities'],
['create', 'manufactured_entities'],
['modify', 'manufactured_entities'],
['modify', 'manufactured_resources'],
['create', 'missions']]
CALLBACK_METHODS =
{ :manufactured_event => manufactured_event,
:users_event        => users_event       }
HOOKS_METHODS =
{ :add_hook => add_hook }
STATE_METHODS =
{ :save_state => save_state,
:restore_state => restore_state }
ASSIGN_METHODS =
{ :assign_mission => assign_mission }
EVENTS_METHODS =
{ :subscribe_to     => subscribe_to,
:unsubscribe      => unsubscribe }
CREATE_METHODS =
{ :create_event => create_event,
:create_mission  => create_mission }
INSPECT_METHODS =
{ :get_status => get_status }

Config options collapse

Config options collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Omega::Server::DSL

#check_attribute, #check_privilege, #cosmos_entity?, #current_session, #current_user, #delete_event_handler_for, #filter_properties, #filters_from_args, #from_valid_source?, #handle_node_closed, #in_subsystem, #is_cmd?, #is_node?, #login, #matching, #persistent_transport?, #remove_callbacks_for, #require_attribute, #require_persistent_transport!, #require_privilege, #require_state, #require_valid_source!, #subsystem, #subsystem_entity?, #subsystem_event?, #validate_session_source!, #with, #with_id

Class Attribute Details

.missions_rjr_passwordObject

Password to use to communicate w/ other modules over the local rjr node


28
29
30
# File 'lib/missions/rjr/init.rb', line 28

def missions_rjr_password
  @missions_rjr_password
end

.missions_rjr_usernameObject

User to use to communicate w/ other modules over the local rjr node


25
26
27
# File 'lib/missions/rjr/init.rb', line 25

def missions_rjr_username
  @missions_rjr_username
end

Class Method Details

.nodeObject


66
67
68
# File 'lib/missions/rjr/init.rb', line 66

def self.node
  @node ||= ::RJR::Nodes::Local.new :node_id => self.user.id
end

.registryObject


82
83
84
# File 'lib/missions/rjr/init.rb', line 82

def self.registry
  @registry ||= Missions::Registry.new
end

.resetObject


90
91
92
# File 'lib/missions/rjr/init.rb', line 90

def self.reset
  Missions::RJR.registry.clear!
end

.set_config(config) ⇒ Object

Set config options using Omega::Config instance


33
34
35
36
# File 'lib/missions/rjr/init.rb', line 33

def set_config(config)
  self.missions_rjr_username  = config.missions_rjr_user
  self.missions_rjr_password  = config.missions_rjr_pass
end

.userObject


56
57
58
59
60
# File 'lib/missions/rjr/init.rb', line 56

def self.user
  @user ||= Users::User.new(:id       => Missions::RJR::missions_rjr_username,
                            :password => Missions::RJR::missions_rjr_password,
                            :registration_code => nil)
end

.user_registryObject


74
75
76
# File 'lib/missions/rjr/init.rb', line 74

def self.user_registry
  Users::RJR.registry
end

Instance Method Details

#nodeObject


70
71
72
# File 'lib/missions/rjr/init.rb', line 70

def node
  Missions::RJR.node
end

#registryObject


86
87
88
# File 'lib/missions/rjr/init.rb', line 86

def registry
  Missions::RJR.registry
end

#userObject


62
63
64
# File 'lib/missions/rjr/init.rb', line 62

def user
  Missions::RJR.user
end

#user_registryObject


78
79
80
# File 'lib/missions/rjr/init.rb', line 78

def user_registry
  Missions::RJR.user_registry
end