Class: Lite::Command::Base
- Inherits:
-
Object
- Object
- Lite::Command::Base
- Defined in:
- lib/lite/command/base.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
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.
29 30 31 |
# File 'lib/lite/command/base.rb', line 29 def initialize(context = {}) @context = Lite::Command::Context.build(context) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
27 28 29 |
# File 'lib/lite/command/base.rb', line 27 def context @context end |
Class Method Details
.inherited(base) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/lite/command/base.rb', line 7 def self.inherited(base) super base.include Lite::Command::Internals::Callable base.include Lite::Command::Internals::Executable base.include Lite::Command::Internals::Resultable base.class_eval " # eg: Users::ResetPassword::Fault\n class \#{base}::Fault < Lite::Command::Fault; end\n RUBY\n\n FAULTS.each do |f|\n base.class_eval <<-RUBY, __FILE__, __LINE__ + 1\n # eg: Users::ResetPassword::Noop < Users::ResetPassword::Fault\n class \#{base}::\#{f.capitalize} < \#{base}::Fault; end\n RUBY\n end\nend\n", __FILE__, __LINE__ + 1 |