Sha256: d59e7692d9075e019a3bb293d25ac1e1280a548178ea185ef94af477a3c758c7

Contents?: true

Size: 1.77 KB

Versions: 36

Compression:

Stored size: 1.77 KB

Contents

# frozen_string_literal: true

# This file is autogenerated by Deimos, Do NOT modify
module Schemas; module MyNamespace
  ### Primary Schema Class ###
  # Autogenerated Schema for Record at com.my-namespace.MySchemaWithCircularReference
  class MySchemaWithCircularReference < Deimos::SchemaClass::Record

    ### Secondary Schema Classes ###
    # Autogenerated Schema for Record at com.my-namespace.Property
    class Property < Deimos::SchemaClass::Record
  
      ### Attribute Accessors ###
      # @return [Boolean, Integer, Integer, Float, Float, String, Array<Property>, Hash<String, Property>]
      attr_accessor :property
  
      # @override
      def initialize(property: nil)
        super
        self.property = property
      end
  
      # @override
      def schema
        'Property'
      end
  
      # @override
      def namespace
        'com.my-namespace'
      end
  
      # @override
      def as_json(_opts={})
        {
          'property' => @property
        }
      end
    end


    ### Attribute Readers ###
    # @return [Hash<String, Property>]
    attr_reader :properties

    ### Attribute Writers ###
    # @return [Hash<String, Property>]
    def properties=(values)
      @properties = values&.transform_values do |value|
        Property.initialize_from_value(value)
      end
    end

    # @override
    def initialize(properties: {})
      super
      self.properties = properties
    end

    # @override
    def schema
      'MySchemaWithCircularReference'
    end

    # @override
    def namespace
      'com.my-namespace'
    end

    def self.tombstone(key)
      record = self.new
      record
    end

    # @override
    def as_json(_opts={})
      {
        'properties' => @properties.transform_values { |v| v&.as_json }
      }
    end
  end
end; end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
deimos-ruby-1.23.3 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.23.2 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.23.1.pre.beta6 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.23.1.pre.beta5 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.23.1.pre.beta4 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.23.1.pre.beta3 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.23.1.pre.beta2 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.23.1.pre.beta1 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.23.0 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.22.5 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.22.4 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.22.3 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.22.2 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.22.1 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.22 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.20.1 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.20.0 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.19.7 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.19.6 spec/schemas/my_namespace/my_schema_with_circular_reference.rb
deimos-ruby-1.19.5 spec/schemas/my_namespace/my_schema_with_circular_reference.rb