Sha256: 88552ecc5628083ffe160d062c20f77de49733ed6147bd063d1d06cc00cb49c5

Contents?: true

Size: 1.34 KB

Versions: 36

Compression:

Stored size: 1.34 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.MySchema
  class MySchema < Deimos::SchemaClass::Record

    ### Attribute Readers ###
    # @return [MySchemaKey]
    attr_reader :payload_key

    ### Attribute Accessors ###
    # @return [String]
    attr_accessor :test_id
    # @return [Integer]
    attr_accessor :some_int

    ### Attribute Writers ###
    # @return [MySchemaKey]
    def payload_key=(value)
      @payload_key = MySchemaKey.initialize_from_value(value)
    end

    # @override
    def initialize(test_id: nil,
                   some_int: nil,
                   payload_key: nil)
      super
      self.test_id = test_id
      self.some_int = some_int
      self.payload_key = payload_key
    end

    # @override
    def schema
      'MySchema'
    end

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

    def self.tombstone(key)
      record = self.new
      record.tombstone_key = MySchemaKey.initialize_from_value(key)
      record.payload_key = key
      record
    end

    # @override
    def as_json(_opts={})
      {
        'test_id' => @test_id,
        'some_int' => @some_int,
        'payload_key' => @payload_key&.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.rb
deimos-ruby-1.23.2 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.23.1.pre.beta6 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.23.1.pre.beta5 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.23.1.pre.beta4 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.23.1.pre.beta3 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.23.1.pre.beta2 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.23.1.pre.beta1 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.23.0 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.22.5 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.22.4 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.22.3 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.22.2 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.22.1 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.22 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.20.1 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.20.0 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.19.7 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.19.6 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.19.5 spec/schemas/my_namespace/my_schema.rb