Sha256: 5a0d09ef0273675f4a49345f06322bf7db8d1dc5a6f6e778f11958a0fa80b871
Contents?: true
Size: 836 Bytes
Versions: 17
Compression:
Stored size: 836 Bytes
Contents
# frozen_string_literal: true module Script module Layers module Domain class ScriptJson attr_reader :content, :version, :title, :description, :configuration_ui, :configuration REQUIRED_FIELDS = %w(version title) def initialize(content:) validate_content!(content) @content = content @version = @content["version"].to_s @title = @content["title"] @description = @content["description"] @configuration_ui = @content["configurationUi"] @configuration = @content["configuration"] end private def validate_content!(content) REQUIRED_FIELDS.each do |field| raise Errors::MissingScriptJsonFieldError, field if content[field].nil? end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems