Sha256: 7f93d5fdb16ff2ac7c82b449c93c1be7e02acbd7a9c2bfdbacd2e074fd29f9b2
Contents?: true
Size: 735 Bytes
Versions: 10
Compression:
Stored size: 735 Bytes
Contents
# frozen_string_literal: true require 'kind/basic' require 'kind/__lib__/attributes' module Kind module ImmutableAttributes module Reader def self.included(base) base.send(:attr_reader, :attributes) end def attribute?(name) self.class.__attributes__.key?(name.to_sym) end def attribute(name) @attributes[name.to_sym] end def attribute!(name) @attributes.fetch(name.to_sym) end def with_attribute(name, value) self.class.new(@_____attrs.merge(name.to_sym => value)) end def with_attributes(arg) hash = STRICT.kind_of(::Hash, arg) self.class.new(@_____attrs.merge(hash)) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems