class Aio::Module::Cmd::Maipu::ShowClock
Public Class Methods
new()
click to toggle source
Calls superclass method
Aio::Module::Cmd::new
# File lib/modules/cmd/maipu/show_clock.rb, line 8 def initialize super({ :cmd_full => "show clock", :cmd_short => "sh clo", :author => "Elin", :description => "This is Maipu Command# show clock", :ranking => Ranking_1, :platform => "all" }) end
Public Instance Methods
parse()
click to toggle source
# File lib/modules/cmd/maipu/show_clock.rb, line 19 def parse context = self.context.dup clock = {} useful[:clock] = clock context.readline_match_block(/(?<zone>.*)\.\d+ (?<week>[^\s]+) (?<month>[^\s]+) (?<day>[^\s]+) (?<time>[^\s]+) (?<year>[^\s]+)/) do |block| block.update(clock, :time) block.update(clock, :zone) block.update(clock, :week) block.update(clock, :year) block.update(clock, :month, Aio::Base::Toolkit::Date.month_to_i(block[:month])) block.update(clock, :day) end end