Class: Y2R::AST::Ruby::Module

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



313
314
315
# File 'lib/y2r/ast/ruby.rb', line 313

def priority
  Priority::NONE
end

#single_line_width_base(context) ⇒ Object



309
310
311
# File 'lib/y2r/ast/ruby.rb', line 309

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

#to_ruby_base(context) ⇒ Object



301
302
303
304
305
306
307
# File 'lib/y2r/ast/ruby.rb', line 301

def to_ruby_base(context)
  combine do |parts|
    parts << "module #{name}"
    parts << indented(statements, context.with_priority(priority))
    parts << "end"
  end
end