Sha256: 05633c2339dcda852046934d58445515b12ca57dc3126db16a25f3c7014c916c
Contents?: true
Size: 567 Bytes
Versions: 8
Compression:
Stored size: 567 Bytes
Contents
# frozen_string_literal: true module Dhis2 class CollectionWrapper def initialize(resource_name, client) @klass = get_resource_klass(resource_name)[client.version] @client = client end def method_missing(method_name, *args, &block) args = args.unshift(@client) @klass.public_send(method_name, *args, &block) end def respond_to_missing?(method_name) @klass.respond_to? method_name end private def get_resource_klass(resource_name) Object.const_get "Dhis2::#{resource_name}" end end end
Version data entries
8 entries across 8 versions & 1 rubygems