Skip to content

Commit

Permalink
made some methods private
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarin committed Oct 11, 2023
1 parent a5604ab commit 6da7bad
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/reports/dynamic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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})"
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6da7bad

Please sign in to comment.