Class: Hx::AddPath

Inherits:
Object
  • Object
show all
Includes:
CircumfixPath
Defined in:
lib/hx.rb

Instance Method Summary collapse

Methods included from CircumfixPath

#initialize

Methods included from Filter

#each_entry

Methods included from View

#each_entry

Instance Method Details

#each_entry_path(selector) ⇒ Object



197
198
199
200
201
202
203
# File 'lib/hx.rb', line 197

def each_entry_path(selector)
  selector = selector.assume_circumfix(@prefix, @suffix)
  @input.each_entry_path(selector) do |path|
    yield add_circumfix(path)
  end
  self
end

#edit_entry(path, prototype = nil) ⇒ Object



190
191
192
193
194
195
# File 'lib/hx.rb', line 190

def edit_entry(path, prototype=nil)
  path = strip_circumfix(path)
  raise EditingNotSupportedError, "Editing not supported for #{path}" unless path
  @input.edit_entry(path, prototype) { |text| yield text }
  self
end

#get_entry(path) ⇒ Object

Raises:



205
206
207
208
209
# File 'lib/hx.rb', line 205

def get_entry(path)
  path = strip_circumfix(path)
  raise NoSuchEntryError, path unless path
  @input.get_entry(path)
end