Sha256: 586d893aa6f23091a92956ac922e048ca6e93b76d3ff376453c922c831526ff9

Contents?: true

Size: 947 Bytes

Versions: 190

Compression:

Stored size: 947 Bytes

Contents

# frozen_string_literal: true

module EacConfig
  class PathsHash
    class PathSearch
      class << self
        def parse_entry_key(string)
          new(::EacConfig::PathsHash.parse_entry_key(string), [])
        end
      end

      common_constructor :current, :previous do
        self.current = current.assert_argument(Array, 'current').freeze
        self.previous = previous.assert_argument(Array, 'previous')
        raise ::EacConfig::PathsHash::EntryKeyError, 'Current is empty' if current.empty?
      end

      def cursor
        current.first
      end

      def ended?
        current.count <= 1
      end

      def raise_error(message)
        raise ::EacConfig::PathsHash::EntryKeyError, "#{message} (#{self})"
      end

      def succeeding
        self.class.new(current[1..-1], previous + [cursor])
      end

      def to_s
        "#{self.class}[Current: #{current}, Previous: #{previous}]"
      end
    end
  end
end

Version data entries

190 entries across 190 versions & 4 rubygems

Version Path
eac_tools-0.82.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.81.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.80.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.79.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_config-0.14.1 lib/eac_config/paths_hash/path_search.rb
eac_tools-0.78.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.77.1 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.77.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.76.1 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.76.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.75.2 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.75.1 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.75.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.74.1 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.74.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_config-0.14.0 lib/eac_config/paths_hash/path_search.rb
eac_tools-0.73.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_config-0.13.0 lib/eac_config/paths_hash/path_search.rb
eac_tools-0.72.0 sub/eac_config/lib/eac_config/paths_hash/path_search.rb
eac_tools-0.70.1 sub/eac_config/lib/eac_config/paths_hash/path_search.rb