Sha256: ac35c9cc5f9034349606e04c47cc83f7d5654d4f95594c5f2afa5f1d8b90f8f2
Contents?: true
Size: 1.08 KB
Versions: 3
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true module Lite module Command class Base def self.inherited(base) 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 super 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lite-command-2.1.2 | lib/lite/command/base.rb |
lite-command-2.1.1 | lib/lite/command/base.rb |
lite-command-2.1.0 | lib/lite/command/base.rb |