Sha256: fcaafee35aab3838b20136f83ccfdf35e9b9a99d00225f9d84a9c36c62e57aa2

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'
require_relative 'errors'
require_relative 'json_schema/schemas'

module Meta
  class Entity
    class << self
      extend Forwardable

      attr_reader :schema_builder

      def inherited(base)
        base.instance_eval do
          @schema_builder = JsonSchema::ObjectSchemaBuilder.new
          @schema_builder.schema_name(self.name) if self.name
        end
      end

      def method_missing(method, *args, **kwargs, &)
        schema_builder.send(method, *args, **kwargs, &)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
meta-api-0.1.1 lib//meta/entity.rb