Sha256: 166b218d102deb21b836b1b29f208132208b44afd4ea450b3e10a23f37e3f7ea

Contents?: true

Size: 737 Bytes

Versions: 8

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

require 'dry-struct'
require 'dry-types'

require_relative '../utils'

module BrregGrunndata
  module Types
    # Include Dry basic types
    #
    # Whenever you see something like Types::String it is a dry type
    include Dry::Types.module

    # Base class for all BrregGrunndata's types
    class Base < Dry::Struct
      # Allow missing keys in the input data.
      # Missing data will get default value or nil.
      constructor_type :schema

      # Merges two base objects together and returns a new instance
      #
      # @return a new instance of self, filled/merged with data from other
      def merge(other)
        Utils::BaseTypeMerger.new(self, other).merge
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
brreg_grunndata-0.1.7 lib/brreg_grunndata/types/base.rb
brreg_grunndata-0.1.6 lib/brreg_grunndata/types/base.rb
brreg_grunndata-0.1.5 lib/brreg_grunndata/types/base.rb
brreg_grunndata-0.1.4 lib/brreg_grunndata/types/base.rb
brreg_grunndata-0.1.3 lib/brreg_grunndata/types/base.rb
brreg_grunndata-0.1.2 lib/brreg_grunndata/types/base.rb
brreg_grunndata-0.1.1 lib/brreg_grunndata/types/base.rb
brreg_grunndata-0.1.0 lib/brreg_grunndata/types/base.rb