Ruby API Client for Zaikio Mission Control.
gem 'zaikio-mission_control'
And then execute:
$ bundle
Or install it yourself as:
$ gem install zaikio-mission_control
# config/initializers/zaikio_mission_control.rb
Zaikio::MissionControl.configure do |config|
config.environment = :production # sandbox or production
end
This gem contains helper methods to list jobs and parts and to understand which parts a job consists of.
Zaikio::MissionControl.jobs => #[:booklet, :box, ...]
Zaikio::MissionControl.parts => #[:back, :base, ...]
Zaikio::MissionControl.finishings => #[:comb_binding, :embossing, ...]
Zaikio::MissionControl.job_klasses => # [Zaikio::MissionControl::Jobs::Booklet, Zaikio::MissionControl::Jobs::Box, ...]
Zaikio::MissionControl.part_klasses => # [Zaikio::MissionControl::Parts::Back, Zaikio::MissionControl::Parts::Base, ...]
Zaikio::MissionControl.finishing_klasses => # [Zaikio::MissionControl::Finishings::CombBinding, Zaikio::MissionControl::Finishings::Embossing, ...]
# Localize models
I18n.with_locale(:de) do
Zaikio::MissionControl::Jobs::Booklet.model_name.human # => Heft
end
Per job you can fetch the parts and their configuration:
Zaikio::MissionControl::Jobs::Booklet.parts # => [:content, :cover, :insert, :outsert]
Zaikio::MissionControl::Jobs::Booklet.part_klasses # => [Zaikio::MissionControl::Parts::Content, ...]
Zaikio::MissionControl::Jobs::Booklet.multiples?(:content) # => true
Zaikio::MissionControl::Jobs::Booklet.multiples?(Zaikio::MissionControl::Parts::Content) # => true
Zaikio::MissionControl::Jobs::Booklet.required?(:content) # => true
Zaikio::MissionControl::Jobs::Booklet.required?(Zaikio::MissionControl::Parts::Content) # => true