Sha256: 672939de009312d2bdf3e19ac6e86e2b3296da3e568fa82e0813ee390ff58003
Contents?: true
Size: 597 Bytes
Versions: 18
Compression:
Stored size: 597 Bytes
Contents
# frozen_string_literal: true module Basketball # Class-level methods that extend core Ruby attr_* methods. module ValueObjectDSL def all_value_keys @all_value_keys ||= ancestors.flat_map do |ancestor| if ancestor < Basketball::ValueObject ancestor.value_keys else [] end end.uniq.sort end def all_sorted_value_keys all_value_keys.sort end def value_keys @value_keys ||= [] end def value_reader(*keys) keys.each { |k| value_keys << k.to_sym } attr_reader(*keys) end end end
Version data entries
18 entries across 18 versions & 1 rubygems