Sha256: 321513a0e7b56375241018782a3d87b71fe77fe1eb77eed8e03d61c999df155d

Contents?: true

Size: 1.34 KB

Versions: 13

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.allocate
      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

13 entries across 13 versions & 1 rubygems

Version Path
deimos-ruby-2.0.0.pre.beta3 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.beta2 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.beta1 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.alpha7 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.alpha6 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.alpha5 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.alpha4 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.alpha3 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.alpha2 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-2.0.0.pre.alpha1 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.24.2 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.24.1 spec/schemas/my_namespace/my_schema.rb
deimos-ruby-1.24.0 spec/schemas/my_namespace/my_schema.rb