Sha256: 41a97c027258cc65b8dea683f0c95d9726fd67b1f148fc74f35586d82d80ada5
Contents?: true
Size: 674 Bytes
Versions: 57
Compression:
Stored size: 674 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' module Avm module Instances class Process class << self # @return [Symbol] def default_id name.demodulize.underscore.to_sym end end acts_as_abstract :available?, :disable, :enable, :enabled? common_constructor :instance, :id, default: [nil] do self.id ||= (id || self.class.default_id).to_sym end def on_disabled(&block) previous_enabled = enabled? begin disable if previous_enabled block.call ensure enable if previous_enabled end end end end end
Version data entries
57 entries across 57 versions & 2 rubygems