Class: Y2R::AST::Ruby::Assignment
- Inherits:
-
Node
- Object
- OpenStruct
- Node
- Y2R::AST::Ruby::Assignment
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?, #single_line_width, #to_ruby
Instance Method Details
874
875
876
|
# File 'lib/y2r/ast/ruby.rb', line 874
def
|| rhs.
end
|
#pass_trailer? ⇒ Boolean
878
879
880
|
# File 'lib/y2r/ast/ruby.rb', line 878
def pass_trailer?
true
end
|
#single_line_width_base(context) ⇒ Object
853
854
855
856
857
858
859
860
861
862
863
864
|
# File 'lib/y2r/ast/ruby.rb', line 853
def single_line_width_base(context)
if !
inner_context = context.with_priority(priority)
lhs_width = lhs.single_line_width(inner_context)
rhs_width = rhs.single_line_width(inner_context)
lhs_width + 3 + rhs_width
else
Float::INFINITY
end
end
|
870
871
872
|
# File 'lib/y2r/ast/ruby.rb', line 870
def
|| lhs.
end
|
#to_ruby_base(context) ⇒ Object
845
846
847
848
849
850
851
|
# File 'lib/y2r/ast/ruby.rb', line 845
def to_ruby_base(context)
if !
to_ruby_base_single_line(context)
else
to_ruby_base_multi_line(context)
end
end
|