From 6da7bad65acb552425ef32d7d1db9031bd1b0f22 Mon Sep 17 00:00:00 2001 From: mw Date: Wed, 11 Oct 2023 13:32:07 -0400 Subject: [PATCH] made some methods private --- lib/reports/dynamic.rb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/reports/dynamic.rb b/lib/reports/dynamic.rb index 85193add..d2870cb6 100644 --- a/lib/reports/dynamic.rb +++ b/lib/reports/dynamic.rb @@ -21,6 +21,16 @@ def initialize(base: "", decorations: [], restrictions: []) @restrictions = add_restrictions(restrictions) end + def self.model + # keys correspond to valid base values. + { + "commitments" => Clusterable::Commitment, + "holdings" => Clusterable::Holding, + "ht_items" => Clusterable::HtItem, + "ocn_resolutions" => Clusterable::OCNResolution + } + end + # a clusterable (e.g. @base) value must match a key in model. def validate_clusterable(clusterable) log "validate_clusterable(#{clusterable})" @@ -124,6 +134,8 @@ def records end end + private + def restrictions_as_hash # from [ {a.b => c}, {d.e => f} ] # to { a.b => c, d.e => f } @@ -158,17 +170,6 @@ def get_field(str) end end - def self.model - # keys correspond to valid base values. - # values correspond to valid decorations/restrictions - { - "commitments" => Clusterable::Commitment, - "holdings" => Clusterable::Holding, - "ht_items" => Clusterable::HtItem, - "ocn_resolutions" => Clusterable::OCNResolution - } - end - # Route messages to the log def log(msg) puts "## " + msg