Sha256: e619693f035b9524dfb90841dd5c3a5fe6bddfa16bfa407e08ab9d42a7ace089
Contents?: true
Size: 682 Bytes
Versions: 6
Compression:
Stored size: 682 Bytes
Contents
module Koine module Attributes module Adapter class Base def coerce(*_values) raise NotImplementedError end def default_value @default_value.respond_to?(:call) && @default_value.call || @default_value end def with_default_value(value = nil, &block) @default_value = value @default_value = block if block self end protected # duplicates if possible and freezes object def secure value = yield value = value.dup if value.respond_to?(:dup) value.freeze end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems