Class: Lite::Command::Base
- Inherits:
-
Object
- Object
- Lite::Command::Base
- Defined in:
- lib/lite/command/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
(also: #ctx)
readonly
Returns the value of attribute context.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(context = {}) ⇒ Base
Returns a new instance of Base.
34 35 36 37 |
# File 'lib/lite/command/base.rb', line 34 def initialize(context = {}) @context = Context.build(context) Utils.try(self, :on_pending) end |
Instance Attribute Details
#context ⇒ Object (readonly) Also known as: ctx
Returns the value of attribute context.
31 32 33 |
# File 'lib/lite/command/base.rb', line 31 def context @context end |
Class Method Details
.inherited(base) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lite/command/base.rb', line 9 def self.inherited(base) super base.include ActiveModel::Validations base.include Internals::Attributes base.include Internals::Calls base.include Internals::Executions base.include Internals::Faults base.include Internals::Results if Lite::Command.configuration.raise_dynamic_faults # rubocop:disable Style/GuardClause base.class_eval " \#{base}::Fault = Class.new(Lite::Command::Fault)\n \#{base}::Noop = Class.new(\#{base}::Fault)\n \#{base}::Invalid = Class.new(\#{base}::Fault)\n \#{base}::Failure = Class.new(\#{base}::Fault)\n \#{base}::Error = Class.new(\#{base}::Fault)\n RUBY\n end\nend\n", __FILE__, __LINE__ + 1 |