Class: Y2R::AST::Ruby::Begin

Inherits:
Node
  • Object
show all
Defined in:
lib/y2r/ast/ruby.rb

Constant Summary

Constants inherited from Node

Node::INDENT_STEP

Instance Method Summary collapse

Methods inherited from Node

#ends_with_comment?, #ensure_separated, #has_comment?, #hates_to_stand_alone?, #pass_trailer?, #single_line_width, #starts_with_comment?, #to_ruby

Instance Method Details

#priorityObject



419
420
421
# File 'lib/y2r/ast/ruby.rb', line 419

def priority
  Priority::NONE
end

#single_line_width_base(context) ⇒ Object



415
416
417
# File 'lib/y2r/ast/ruby.rb', line 415

def single_line_width_base(context)
  Float::INFINITY   # always multiline
end

#to_ruby_base(context) ⇒ Object



407
408
409
410
411
412
413
# File 'lib/y2r/ast/ruby.rb', line 407

def to_ruby_base(context)
  combine do |parts|
    parts << "begin"
    parts << indented(statements, context.with_priority(priority))
    parts << "end"
  end
end