Sha256: a6c0e48785780604b9016ec01496684f8b0e07a600e18ec16a0e5e6a82966f51
Contents?: true
Size: 599 Bytes
Versions: 11
Compression:
Stored size: 599 Bytes
Contents
# frozen_string_literal: true module LedgerSync module Domains class Operation class Resource include LedgerSync::Domains::Operation::Mixin def resource_class @resource_class ||= inferred_resource_class end private def inferred_resource_class name = self.class.to_s.split('::') name.pop # remove serializer/operation class from name resource = name.pop.singularize # pluralized resource module name self.class.const_get((name + [resource]).join('::')) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems