Sha256: 51a63a92ffcd947137800ac409edc50fdbc5dc0f635ab52f08859d7477e78d41
Contents?: true
Size: 840 Bytes
Versions: 8
Compression:
Stored size: 840 Bytes
Contents
class ProconBypassMan::Procon::MacroRegistry class Macro attr_accessor :name, :steps def initialize(name: , steps: ) self.name = name self.steps = steps end def next_step steps.shift end def finished? steps.empty? end def ongoing? !finished? end end PRESETS = { null: [], } def self.install_plugin(klass) if plugins[klass.name] raise "すでに登録済みです" end plugins[klass.name] = klass.steps end def self.load(name) steps = PRESETS[name] || plugins[name] || raise("unknown macro") Macro.new(name: name, steps: steps.dup) end def self.reset! ProconBypassMan::Configuration.instance.macro_plugins = {} end def self.plugins ProconBypassMan::Configuration.instance.macro_plugins end reset! end
Version data entries
8 entries across 8 versions & 1 rubygems