Class: MotherBrain::CleanRoomBase
- Inherits:
-
Object
- Object
- MotherBrain::CleanRoomBase
- Includes:
- Logging
- Defined in:
- lib/mb/clean_room_base.rb
Direct Known Subclasses
Bootstrap::Routine::CleanRoom, MotherBrain::Command::CleanRoom, MotherBrain::CommandRunner::CleanRoom, MotherBrain::Component::CleanRoom, Gear::Service::ActionRunner::CleanRoom, Gear::Service::CleanRoom, Group::CleanRoom, Plugin::CleanRoom
Class Method Summary collapse
-
.dsl_attr_writer(attribute) ⇒ Object
Create a DSL writer function that will assign the a given value to the real object of this clean room.
Instance Method Summary collapse
-
#initialize(real_model, &block) ⇒ CleanRoomBase
constructor
A new instance of CleanRoomBase.
Methods included from Logging
add_argument_header, dev, filename, #log_exception, logger, #logger, reset, set_logger, setup
Constructor Details
#initialize(real_model, &block) ⇒ CleanRoomBase
Returns a new instance of CleanRoomBase.
20 21 22 |
# File 'lib/mb/clean_room_base.rb', line 20 def initialize(real_model, &block) @real_model = real_model end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object (private)
32 33 34 35 36 37 |
# File 'lib/mb/clean_room_base.rb', line 32 def method_missing(method_name, *args, &block) ErrorHandler.wrap PluginSyntaxError, backtrace: caller, method_name: method_name, text: "'#{method_name}' is not a valid keyword" end |
Class Method Details
.dsl_attr_writer(attribute) ⇒ Object
Create a DSL writer function that will assign the a given value to the real object of this clean room.
8 9 10 11 12 13 14 |
# File 'lib/mb/clean_room_base.rb', line 8 def dsl_attr_writer(attribute) class_eval do define_method(attribute) do |value| set_attribute(attribute, value) end end end |