Sha256: 265cee985c9a2c3f5a20df0668480f81474db4720a0431f225b233fe8a496151
Contents?: true
Size: 597 Bytes
Versions: 9
Compression:
Stored size: 597 Bytes
Contents
module Economic class DepartmentalDistributionRepo < Economic::BaseRepo class << self def all(distribution: nil) return super(url: endpoint_url(distribution)) unless distribution.nil? super(url: endpoint_url(distribution)) end def find(id, distribution:) super(id, url: endpoint_url(distribution)) end private def endpoint_url(distribution) return super() if distribution.nil? return super() + "/departments" if distribution == :single_department super() + "/distributions" end end end end
Version data entries
9 entries across 9 versions & 1 rubygems