Class: RBS::AST::Members::Prepend

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/rbs/members.rb

Instance Method Summary collapse

Instance Method Details

#format(q) ⇒ Object

Prints out a prepend, which looks like: prepend Foo



370
371
372
373
374
375
376
377
378
# File 'lib/syntax_tree/rbs/members.rb', line 370

def format(q)
  SyntaxTree::RBS::Comment.maybe_format(q, comment)
  SyntaxTree::RBS::Annotations.maybe_format(q, annotations)

  q.group do
    q.text("prepend ")
    SyntaxTree::RBS::NameAndArgs.new(self).format(q)
  end
end

#pretty_print(q) ⇒ Object



380
381
382
383
384
385
386
# File 'lib/syntax_tree/rbs/members.rb', line 380

def pretty_print(q)
  q.group(2, "(prepend", ")") do
    SyntaxTree::RBS::Comment.maybe_pretty_print(q, comment)
    SyntaxTree::RBS::Annotations.maybe_pretty_print(q, annotations)
    q.pp(SyntaxTree::RBS::NameAndArgs.new(self))
  end
end