Class: Unparser::Writer::Rescue

Inherits:
Object
  • Object
show all
Includes:
Adamantium, Unparser::Writer
Defined in:
lib/unparser/writer/rescue.rb

Constant Summary

Constants included from Generation

Generation::EXTRA_NL

Instance Method Summary collapse

Methods included from Unparser::Writer

included

Methods included from Generation

#symbol_name, #write_to_buffer

Methods included from NodeHelpers

#n, #n?, #s, #unwrap_single_begin

Instance Method Details

#emit_heredoc_remindersObject



23
24
25
# File 'lib/unparser/writer/rescue.rb', line 23

def emit_heredoc_reminders
  emitter(body).emit_heredoc_reminders
end

#emit_postcontrolObject



27
28
29
30
# File 'lib/unparser/writer/rescue.rb', line 27

def emit_postcontrol
  visit(body)
  writer_with(Resbody, rescue_body).emit_postcontrol
end

#emit_regularObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/unparser/writer/rescue.rb', line 12

def emit_regular
  emit_optional_body(body)

  rescue_bodies.each(&method(:emit_rescue_body))

  if else_node
    write('else')
    emit_body(else_node)
  end
end