Class: Passenger

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/exogenesis/support/passenger.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, executor = Executor.instance) ⇒ Passenger

Returns a new instance of Passenger.



53
54
55
56
# File 'lib/exogenesis/support/passenger.rb', line 53

def initialize(config, executor = Executor.instance)
  @config = config
  @executor = executor
end

Class Attribute Details

.passengersObject

Returns the value of attribute passengers.



8
9
10
# File 'lib/exogenesis/support/passenger.rb', line 8

def passengers
  @passengers
end

Class Method Details

.by_name(name) ⇒ Object



10
11
12
# File 'lib/exogenesis/support/passenger.rb', line 10

def by_name(name)
  passengers[name]
end

.emoji_nameObject



27
28
29
# File 'lib/exogenesis/support/passenger.rb', line 27

def emoji_name
  @emoji_name || :alien
end

.needs(config_name) ⇒ Object



19
20
21
# File 'lib/exogenesis/support/passenger.rb', line 19

def needs(config_name)
  def_delegator :@config, config_name
end

.register_as(name) ⇒ Object



14
15
16
17
# File 'lib/exogenesis/support/passenger.rb', line 14

def register_as(name)
  Passenger.passengers = {} if Passenger.passengers.nil?
  Passenger.passengers[name.to_s] = self
end

.with_emoji(emoji_name) ⇒ Object



23
24
25
# File 'lib/exogenesis/support/passenger.rb', line 23

def with_emoji(emoji_name)
  @emoji_name = emoji_name
end