Class: Rootage::ProcessContext
- Inherits:
-
Object
- Object
- Rootage::ProcessContext
- Defined in:
- lib/rootage/core.rb
Overview
ProcessContext
is a context for processes. Each process is evaluated in
this context object.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#scenario ⇒ Object
readonly
Returns the value of attribute scenario.
Class Method Summary collapse
-
.make(&block) ⇒ Object
Make a subclass.
Instance Method Summary collapse
-
#fail ⇒ Object
Fail the process.
-
#initialize(scenario) ⇒ ProcessContext
constructor
A new instance of ProcessContext.
-
#test(val) ⇒ Object
Test the value.
Constructor Details
#initialize(scenario) ⇒ ProcessContext
Returns a new instance of ProcessContext.
444 445 446 447 |
# File 'lib/rootage/core.rb', line 444 def initialize(scenario) @scenario = scenario @model = scenario.model end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
440 441 442 |
# File 'lib/rootage/core.rb', line 440 def model @model end |
#scenario ⇒ Object (readonly)
Returns the value of attribute scenario.
439 440 441 |
# File 'lib/rootage/core.rb', line 439 def scenario @scenario end |
Class Method Details
.make(&block) ⇒ Object
Make a subclass.
433 434 435 436 437 |
# File 'lib/rootage/core.rb', line 433 def self.make(&block) klass = Class.new(self) klass.instance_exec(&block) return klass end |
Instance Method Details
#fail ⇒ Object
Fail the process.
456 457 458 |
# File 'lib/rootage/core.rb', line 456 def fail throw :rootage_process_failure, false end |