module Fried::Schema::Struct

Provides {.attribute} macro which allows to easily define type-safe accessors. The attributes are initialized with default values or with {nil} if none was provided

Public Class Methods

included(klass) click to toggle source
# File lib/fried/schema/struct.rb, line 44
def self.included(klass)
  CreateDefinitionIfMissing.(klass)

  klass.instance_eval do
    include Initializer
    extend ClassMethods
    include ::Fried::Typings
    include Comparable
  end
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/fried/schema/struct.rb, line 55
def <=>(other)
  schema = GetDefinition.(self.class)

  Compare.(schema, self, other)
end