Sha256: 007eb611da06e2436d146b8829611716c1f8087c32b106d126dd46a33a990fb5
Contents?: true
Size: 1.08 KB
Versions: 1
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true module Lite module Command class Base def self.inherited(base) super base.include Lite::Command::Internals::Context base.include Lite::Command::Internals::Call base.include Lite::Command::Internals::Execute base.include Lite::Command::Internals::Fault base.include Lite::Command::Internals::Result base.class_eval <<-RUBY, __FILE__, __LINE__ + 1 # eg: Users::ResetPassword::Fault < Lite::Command::Fault #{base}::Fault = Class.new(Lite::Command::Fault) # eg: Users::ResetPassword::Noop < Users::ResetPassword::Fault #{base}::Noop = Class.new(#{base}::Fault) #{base}::Invalid = Class.new(#{base}::Fault) #{base}::Failure = Class.new(#{base}::Fault) #{base}::Error = Class.new(#{base}::Fault) RUBY end attr_reader :context alias ctx context def initialize(context = {}) @context = Lite::Command::Context.build(context) Utils.hook(self, :on_pending) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lite-command-2.1.3 | lib/lite/command/base.rb |