Sha256: ad0e0add3a8ba030aff1ffaf5241a04a00325ec8e7d090c5a409531d9f4c7b85
Contents?: true
Size: 786 Bytes
Versions: 130
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true require 'eac_fs/contexts' require 'eac_fs/patches/module/fs_cache' class Object ::EacFs::Contexts::TYPES.each do |type| class_eval <<~CODE, __FILE__, __LINE__ + 1 # @return [EacFs::StorageTree] def fs_#{type} oid = fs_object_id_by_type(:'#{type}') oid = [oid.to_s] unless oid.is_a?(::Enumerable) oid.inject(fs_#{type}_parent) { |a, e| a.child(e.to_s) } end # @return [EacFs::StorageTree] def fs_#{type}_parent self.class.fs_#{type} end CODE end # @return [String, Array<String>] def fs_object_id raise 'Abstract method hit' end def fs_object_id_by_type(type) method = "fs_#{type}_object_id" respond_to?(method) ? send(method) : fs_object_id end end
Version data entries
130 entries across 130 versions & 3 rubygems