Sha256: 2c321020e8a0cc40b609a08712c7764da912d8664ed61b5b7bad069cdbb41eba

Contents?: true

Size: 754 Bytes

Versions: 3

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'
require 'eac_templates/interface_methods'

module EacTemplates
  module Modules
    class Ancestor
      class FsObject
        enable_simple_cache
        common_constructor :base
        delegate(*::EacTemplates::InterfaceMethods::COMMON, :found?, to: :source_object)

        # @return [Symbol]
        def object_type
          self.class.name.demodulize.underscore.to_sym
        end

        # @return [Pathname, nil]
        def path
          source_object.found? ? source_object.send(:real_paths).first : nil
        end

        private

        def source_object_uncached
          base.source_set.send(object_type, base.path_for_search)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
eac_tools-0.61.0 sub/eac_templates/lib/eac_templates/modules/ancestor/fs_object.rb
eac_templates-0.4.0 lib/eac_templates/modules/ancestor/fs_object.rb
eac_tools-0.60.3 sub/eac_templates/lib/eac_templates/modules/ancestor/fs_object.rb