Sha256: 5d20d8d6dc4829caf52a1ddb291304573f650ea6edcd2878c4a9524721b8c3e9

Contents?: true

Size: 619 Bytes

Versions: 49

Compression:

Stored size: 619 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Avm
  module EacGenericBase0
    class FileFormats
      class Base < ::Avm::FileFormats::Base
        module FileResourceNameHelper
          def result_from_patterns(patterns, path)
            patterns.lazy.map { |pattern| pattern.to_parser.parse(path.to_path) }
              .find(&:present?).if_present { |v| yield(v) }
          end

          def result_from_superclass(path)
            self.class.superclass.instance_method(:file_resource_name)
              .bind_call(self, path)
          end
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
eac_tools-0.55.3 sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb
eac_tools-0.55.2 sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb
eac_tools-0.55.1 sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb
eac_tools-0.55.0 sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb
avm-eac_generic_base0-0.10.0 lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb
eac_tools-0.54.0 sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb
eac_tools-0.53.0 sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb
avm-eac_generic_base0-0.9.0 lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb
eac_tools-0.52.0 sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/file_formats/base/file_resource_name_helper.rb