Class: Y2R::AST::Ruby::Statements
- Inherits:
-
Node
- Object
- OpenStruct
- Node
- Y2R::AST::Ruby::Statements
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
#ensure_separated, #has_comment?, #hates_to_stand_alone?, #pass_trailer?, #single_line_width, #to_ruby
Instance Method Details
400
401
402
403
|
# File 'lib/y2r/ast/ruby.rb', line 400
def
||
(statements.size > 0 && statements.last.)
end
|
#priority ⇒ Object
391
392
393
|
# File 'lib/y2r/ast/ruby.rb', line 391
def priority
Priority::NONE
end
|
#single_line_width_base(context) ⇒ Object
378
379
380
381
382
383
384
385
386
387
388
389
|
# File 'lib/y2r/ast/ruby.rb', line 378
def single_line_width_base(context)
case statements.size
when 0
0
when 1
statement_context = context.with_priority(priority)
statements.first.single_line_width(statement_context)
else
Float::INFINITY
end
end
|
395
396
397
398
|
# File 'lib/y2r/ast/ruby.rb', line 395
def
||
(statements.size > 0 && statements.first.)
end
|
#to_ruby_base(context) ⇒ Object
367
368
369
370
371
372
373
374
375
376
|
# File 'lib/y2r/ast/ruby.rb', line 367
def to_ruby_base(context)
combine do |parts|
statements.compact.each do |statement|
parts << statement.to_ruby(context.with_priority(priority))
end
end
end
|