Class: Test01::UserService
- Inherits:
-
EventBus::Singleton
- Object
- EventBus::Singleton
- Test01::UserService
- Defined in:
- lib/ls4/lib/ebus.rb
Instance Method Summary collapse
- #add(uid, name) ⇒ Object
- #added?(uid) ⇒ Boolean
- #get(uid) ⇒ Object
-
#initialize ⇒ UserService
constructor
A new instance of UserService.
Methods included from EventBus::SingletonMixin
#ebus_bind!, #ebus_connect, extended
Methods included from EventBus::BusMixin
#ebus_all_slots, #ebus_disconnect!
Methods included from EventBus::DeclarerBase::Methods
#connect, #ebus_all_slots, #ebus_call_log, #ebus_call_slots, #ebus_signal_error, #ebus_signal_log, #ebus_signal_slots
Methods included from EventBus::DeclarerBase
Constructor Details
#initialize ⇒ UserService
Returns a new instance of UserService.
362 363 364 |
# File 'lib/ls4/lib/ebus.rb', line 362 def initialize @db = {} end |
Instance Method Details
#add(uid, name) ⇒ Object
366 367 368 369 370 |
# File 'lib/ls4/lib/ebus.rb', line 366 def add(uid, name) @db[uid] = name Users.user_added(uid) name end |
#added?(uid) ⇒ Boolean
376 377 378 |
# File 'lib/ls4/lib/ebus.rb', line 376 def added?(uid) @db.has_key?(uid) end |
#get(uid) ⇒ Object
372 373 374 |
# File 'lib/ls4/lib/ebus.rb', line 372 def get(uid) @db[uid] end |