Class: EacRubyUtils::PathsHash::PathSearch

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/paths_hash/path_search.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse_entry_key(string) ⇒ Object


7
8
9
# File 'lib/eac_ruby_utils/paths_hash/path_search.rb', line 7

def parse_entry_key(string)
  new(::EacRubyUtils::PathsHash.parse_entry_key(string), [])
end

Instance Method Details

#cursorObject


18
19
20
# File 'lib/eac_ruby_utils/paths_hash/path_search.rb', line 18

def cursor
  current.first
end

#ended?Boolean

Returns:


22
23
24
# File 'lib/eac_ruby_utils/paths_hash/path_search.rb', line 22

def ended?
  current.count <= 1
end

#raise_error(message) ⇒ Object


26
27
28
# File 'lib/eac_ruby_utils/paths_hash/path_search.rb', line 26

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

#succeedingObject


30
31
32
# File 'lib/eac_ruby_utils/paths_hash/path_search.rb', line 30

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

#to_sObject


34
35
36
# File 'lib/eac_ruby_utils/paths_hash/path_search.rb', line 34

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