Class: Zenaton::Workflows::Version Abstract
- Inherits:
-
Interfaces::Workflow
- Object
- Interfaces::Job
- Interfaces::Workflow
- Zenaton::Workflows::Version
- Includes:
- Traits::Zenatonable
- Defined in:
- lib/zenaton/workflows/version.rb
Overview
This class is abstract.
Subclass and override #versions to create your own versionned
workflows
Instance Method Summary collapse
-
#current ⇒ Class
Get the current implementation class.
-
#current_implementation ⇒ Zenaton::Interfaces::Workflow
Returns an instance of the current implementation.
-
#handle ⇒ Object
Calls handle on the current implementation.
-
#initial ⇒ Class
Get the first implementation class.
-
#initialize(*args) ⇒ Version
constructor
A new instance of Version.
-
#versions ⇒ Array<Class>
version, ordered from the oldest to the most recent version.
Methods included from Traits::Zenatonable
Methods inherited from Interfaces::Workflow
Constructor Details
#initialize(*args) ⇒ Version
Returns a new instance of Version.
22 23 24 |
# File 'lib/zenaton/workflows/version.rb', line 22 def initialize(*args) @args = args end |
Instance Method Details
#current ⇒ Class
Get the current implementation class
33 34 35 |
# File 'lib/zenaton/workflows/version.rb', line 33 def current _get_versions[-1] end |
#current_implementation ⇒ Zenaton::Interfaces::Workflow
Returns an instance of the current implementation
45 46 47 |
# File 'lib/zenaton/workflows/version.rb', line 45 def current_implementation current.new(*@args) end |
#handle ⇒ Object
Calls handle on the current implementation
27 28 29 |
# File 'lib/zenaton/workflows/version.rb', line 27 def handle current_implementation.handle end |
#initial ⇒ Class
Get the first implementation class
39 40 41 |
# File 'lib/zenaton/workflows/version.rb', line 39 def initial _get_versions[0] end |
#versions ⇒ Array<Class>
version, ordered from the oldest to the most recent version
17 18 19 20 |
# File 'lib/zenaton/workflows/version.rb', line 17 def versions raise NotImplemented, "Please override the `versions' method in your subclass" end |