Sha256: e96854312a4b6c39bbaf518e2d91b942572e7e1f1e5653a9ef17c86427c52a9f
Contents?: true
Size: 747 Bytes
Versions: 21
Compression:
Stored size: 747 Bytes
Contents
class TaskDefinition NotFound = Class.new(StandardError) class << self def load(payload) return unless payload.present? json = JSON.parse(payload) new(json.delete('id'), json) end def dump(definition) return unless definition.present? JSON.dump(definition.as_json) end end attr_reader :id, :action, :description, :steps, :checklist def initialize(id, config) @id = id @action = config['action'] @description = config['description'] || '' @steps = config['steps'] || [] @checklist = config['checklist'] || [] end def as_json { id: id, action: action, description: description, steps: steps, checklist: checklist, } end end
Version data entries
21 entries across 21 versions & 1 rubygems