Class: Andromeda::Cmd::Parser

Inherits:
Plan show all
Defined in:
lib/andromeda/cmd.rb

Instance Attribute Summary

Attributes inherited from Plan

#error_level, #log, #marker, #nick, #trace_enter, #trace_exit

Attributes inherited from Impl::ProtoPlan

#guide, #id

Instance Method Summary collapse

Methods inherited from Plan

#initialize, #initialize_copy, #pool, #tap, #to_short_s

Methods inherited from Impl::ProtoPlan

#>>, #current_name, #current_scope, #data_key, #data_tag, #data_val, #dest, #entry, #init_guide, #initialize, #initialize_copy, #key_label, #key_spot, #map_data, #mute, name_spot, #post_data, #post_to, #public_spot, #selects?, #signal_name?, signal_names, #signal_names, signal_spot, spot_attr, #spot_attr_name?, spot_attr_names, #spot_attr_names, spot_meth, #spot_meth_name?, spot_meth_names, #spot_meth_names, #spot_name?, spot_names, #spot_names, #tags, #to_short_s, #via

Methods included from Impl::To_S

short_s, #to_s, #to_short_s

Methods inherited from Impl::ConnectorBase

#post, #post_local, #start

Constructor Details

This class inherits a constructor from Andromeda::Plan

Instance Method Details

#on_enter(key, val) ⇒ Object



231
232
233
234
235
236
237
238
# File 'lib/andromeda/cmd.rb', line 231

def on_enter(key, val)
  data = val[:data].chomp
  data = JSON::parse(data)
  cmd  = Cmd.new val[:cmd], data, val[:time]
  rem  = val[:comment] rescue nil
  cmd.with_comment rem if rem
  exit << cmd if cmd
end