Class: Fantasy::Event::Factory
- Inherits:
-
Object
- Object
- Fantasy::Event::Factory
- Defined in:
- lib/fantasy-irc/events.rb
Instance Method Summary collapse
- #by_name(name) ⇒ Object
- #create(name) ⇒ Object
-
#initialize ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize ⇒ Factory
Returns a new instance of Factory.
6 7 8 9 |
# File 'lib/fantasy-irc/events.rb', line 6 def initialize puts "Initializing new Event::Factory #{self}" @events = Hash.new end |
Instance Method Details
#by_name(name) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/fantasy-irc/events.rb', line 22 def by_name name name.downcase! if not @events[name] then raise "Tried to access unknown event \"#{name}\" in Event::Factory \"#{self}\"" end @events[name] end |