Class: CloneKit::Specification
- Inherits:
-
Object
- Object
- CloneKit::Specification
- Defined in:
- lib/clone_kit/specification.rb
Direct Known Subclasses
Constant Summary collapse
Instance Attribute Summary collapse
-
#after_operation_block ⇒ Object
Returns the value of attribute after_operation_block.
-
#cloner ⇒ Object
Returns the value of attribute cloner.
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#emitter ⇒ Object
Returns the value of attribute emitter.
-
#model ⇒ Object
Returns the value of attribute model.
Instance Method Summary collapse
- #after_operation(&block) ⇒ Object
-
#initialize(model, &block) ⇒ Specification
constructor
A new instance of Specification.
Constructor Details
#initialize(model, &block) ⇒ Specification
Returns a new instance of Specification.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/clone_kit/specification.rb', line 20 def initialize(model, &block) self.model = model self.emitter = EMPTY_EMITTER self.cloner = NO_OP_CLONER self.dependencies = [] self.after_operation_block = ->(_op) {} configure validate! model.instance_exec(self, &block) CloneKit.add_specification(self) end |
Instance Attribute Details
#after_operation_block ⇒ Object
Returns the value of attribute after_operation_block.
11 12 13 |
# File 'lib/clone_kit/specification.rb', line 11 def after_operation_block @after_operation_block end |
#cloner ⇒ Object
Returns the value of attribute cloner.
11 12 13 |
# File 'lib/clone_kit/specification.rb', line 11 def cloner @cloner end |
#dependencies ⇒ Object
Returns the value of attribute dependencies.
11 12 13 |
# File 'lib/clone_kit/specification.rb', line 11 def dependencies @dependencies end |
#emitter ⇒ Object
Returns the value of attribute emitter.
11 12 13 |
# File 'lib/clone_kit/specification.rb', line 11 def emitter @emitter end |
#model ⇒ Object
Returns the value of attribute model.
11 12 13 |
# File 'lib/clone_kit/specification.rb', line 11 def model @model end |
Instance Method Details
#after_operation(&block) ⇒ Object
35 36 37 |
# File 'lib/clone_kit/specification.rb', line 35 def after_operation(&block) self.after_operation_block = block end |