module Lab42::NHash::Afixes

Public Instance Methods

current_prefix() click to toggle source
# File lib/lab42/nhash/affixes.rb, line 11
def current_prefix
  @prefix_stack
  .fetch( -1, '' )
  .split( '.' )
end
current_suffix() click to toggle source
# File lib/lab42/nhash/affixes.rb, line 17
def current_suffix
  @suffix_stack
  .fetch( -1, '' )
  .split( '.' )
end
pop_prefix() click to toggle source
# File lib/lab42/nhash/affixes.rb, line 6
def pop_prefix; @prefix_stack.pop; self end
pop_suffix() click to toggle source
# File lib/lab42/nhash/affixes.rb, line 7
def pop_suffix; @suffix_stack.pop; self end
push_prefix(pfx;) click to toggle source
# File lib/lab42/nhash/affixes.rb, line 8
def push_prefix pfx; @prefix_stack.push pfx.to_s; self end
push_suffix(sfx;) click to toggle source
# File lib/lab42/nhash/affixes.rb, line 9
def push_suffix sfx; @suffix_stack.push sfx.to_s; self end
with_affixes(pfx, sfx, &blk) click to toggle source
# File lib/lab42/nhash/affixes.rb, line 23
def with_affixes pfx, sfx, &blk
  push_prefix pfx
  push_suffix sfx
  _invoke blk, self
ensure
  pop_prefix
  pop_suffix
end
with_prefix(pfx, &blk) click to toggle source
# File lib/lab42/nhash/affixes.rb, line 32
def with_prefix pfx, &blk
  push_prefix pfx
  _invoke blk, self
ensure
  pop_prefix
end
with_suffix(sfx, &blk) click to toggle source
# File lib/lab42/nhash/affixes.rb, line 39
def with_suffix sfx, &blk
  push_suffix sfx
  _invoke blk, self
ensure
  pop_suffix
end