Sha256: 96972ef653510bdab20b4a21fb2424f351cf28c6a8f128d9be4423ffcc9f1ab1
Contents?: true
Size: 835 Bytes
Versions: 22
Compression:
Stored size: 835 Bytes
Contents
# frozen_string_literal: true module Extension module Models module SpecificationHandlers module WebPixelExtensionUtils class ScriptConfig attr_reader :content, :version, :configuration, :filename REQUIRED_FIELDS = %w(version) def initialize(content:, filename:) @filename = filename validate_content!(content) @content = content @version = @content["version"].to_s @configuration = @content["configuration"] end private def validate_content!(content) REQUIRED_FIELDS.each do |field| if content[field].nil? raise "invalid field:#{field}, filename:#{filename}" end end end end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems