Class: LaunchPad::Parser
- Inherits:
-
Object
- Object
- LaunchPad::Parser
- Includes:
- LaunchPad
- Defined in:
- lib/launch-pad/parser.rb
Constant Summary
Constants included from LaunchPad
Class Method Summary collapse
Class Method Details
.parse(message) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/launch-pad/parser.rb', line 9 def self.parse() commands = nil incoming = YAML::load(.to_s).symbolize_keys key = :register unless incoming[:unregister].nil? key = :unregister end begin command = "LaunchPad::#{incoming[key].camelize}".constantize.new(incoming) rescue NameError => exception raise UndefinedRegistrationException.new exception end command end |