Sha256: 9dbd49a5472e3646ab17c659167ba2e60f9389bb250b531b2af61fd1de051ea8

Contents?: true

Size: 412 Bytes

Versions: 6

Compression:

Stored size: 412 Bytes

Contents

# frozen_string_literal: true

class Zilla::Versions::V20::Definition
  include Memery

  attr_reader :name, :json, :definitions

  def initialize(name, json, definitions: {})
    @name = name
    @json = json
    @definitions = definitions
  end

  def valid?(*, **) = schema.valid?(*, **)

  memoize def schema = JSONSchemer.schema(json.merge("definitions" => definitions), insert_property_defaults: true)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
zilla-0.1.5 lib/zilla/versions/v20/definition.rb
zilla-0.1.4 lib/zilla/versions/v20/definition.rb
zilla-0.1.3 lib/zilla/versions/v20/definition.rb
zilla-0.1.2 lib/zilla/versions/v20/definition.rb
zilla-0.1.1 lib/zilla/versions/v20/definition.rb
zilla-0.1.0 lib/zilla/versions/v20/definition.rb