Sha256: 90713288bd4090cd4fd5cc32bbf601bb964dd484fa98984e989694f58a93576f
Contents?: true
Size: 553 Bytes
Versions: 16
Compression:
Stored size: 553 Bytes
Contents
module Hiroshimarb # コマンドを実装する際の基底クラス class Command class << self def commands @commands ||= {} end def inherited(subclass) name = subclass.command_name commands[name] = subclass end def find(command_name) if command = commands[command_name.to_sym] command.new else nil end end def command_name name.split('::').last.downcase.to_sym end end def call(arg) end end end
Version data entries
16 entries across 16 versions & 1 rubygems