Class: Opera::Operation::Builder::InnerBuilder
- Inherits:
-
Object
- Object
- Opera::Operation::Builder::InnerBuilder
- Defined in:
- lib/opera/operation/builder.rb
Instance Attribute Summary collapse
-
#instructions ⇒ Object
readonly
Returns the value of attribute instructions.
Instance Method Summary collapse
- #always(_method) ⇒ Object
-
#initialize(&block) ⇒ InnerBuilder
constructor
A new instance of InnerBuilder.
Constructor Details
#initialize(&block) ⇒ InnerBuilder
Returns a new instance of InnerBuilder.
40 41 42 43 |
# File 'lib/opera/operation/builder.rb', line 40 def initialize(&block) @instructions = [] instance_eval(&block) if block_given? end |
Instance Attribute Details
#instructions ⇒ Object (readonly)
Returns the value of attribute instructions.
38 39 40 |
# File 'lib/opera/operation/builder.rb', line 38 def instructions @instructions end |
Instance Method Details
#always(_method) ⇒ Object
62 63 64 65 66 |
# File 'lib/opera/operation/builder.rb', line 62 def always(_method) raise ArgumentError, '`always` cannot be used inside a block (transaction, within, success, validate). ' \ 'Place `always` steps at the top level of the operation, after all other instructions.' end |