class Unparser::Emitter::Hash

Emitter for Hash literals

Public Instance Methods

emit_heredoc_reminders() click to toggle source
# File lib/unparser/emitter/hash.rb, line 17
def emit_heredoc_reminders
  children.each(&method(:emit_heredoc_reminder_member))
end
emit_last_argument_hash() click to toggle source
# File lib/unparser/emitter/hash.rb, line 9
def emit_last_argument_hash
  if children.empty?
    write('{}')
  else
    emit_hash_body
  end
end

Private Instance Methods

dispatch() click to toggle source
# File lib/unparser/emitter/hash.rb, line 23
def dispatch
  if children.empty?
    write('{}')
  else
    parentheses('{', '}') do
      write(' ')
      emit_hash_body
      write(' ')
    end
  end
end
emit_hash_body() click to toggle source
# File lib/unparser/emitter/hash.rb, line 39
def emit_hash_body
  delimited(children)
end
emit_heredoc_reminder_member(node) click to toggle source
# File lib/unparser/emitter/hash.rb, line 35
def emit_heredoc_reminder_member(node)
  emitter(node.children.last).emit_heredoc_reminders
end