Class: Y2R::AST::Ruby::Node
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Y2R::AST::Ruby::Node
show all
- Defined in:
- lib/y2r/ast/ruby.rb
Direct Known Subclasses
Array, Assignment, Begin, BinaryOperator, Block, Break, Case, Class, ConstAccess, Def, Else, Expressions, Hash, HashEntry, If, Literal, MethodCall, Module, Next, Program, Return, Self, Statements, TernaryOperator, UnaryOperator, Unless, Until, Variable, When, While
Constant Summary
collapse
- INDENT_STEP =
2
Instance Method Summary
collapse
Instance Method Details
117
118
119
|
# File 'lib/y2r/ast/ruby.rb', line 117
def
end
|
#ensure_separated ⇒ Object
129
130
131
132
133
134
135
|
# File 'lib/y2r/ast/ruby.rb', line 129
def ensure_separated
if && !.start_with?("\n")
self. = "\n#{comment_before}"
else
self. = ""
end
end
|
121
122
123
|
# File 'lib/y2r/ast/ruby.rb', line 121
def
||
end
|
#hates_to_stand_alone? ⇒ Boolean
109
110
111
|
# File 'lib/y2r/ast/ruby.rb', line 109
def hates_to_stand_alone?
false
end
|
#pass_trailer? ⇒ Boolean
125
126
127
|
# File 'lib/y2r/ast/ruby.rb', line 125
def pass_trailer?
false
end
|
#single_line_width(context) ⇒ Object
101
102
103
104
105
106
107
|
# File 'lib/y2r/ast/ruby.rb', line 101
def single_line_width(context)
context do ||
wrap_width_with_parens do |parens_context|
single_line_width_base(parens_context)
end
end
end
|
113
114
115
|
# File 'lib/y2r/ast/ruby.rb', line 113
def
end
|
#to_ruby(context) ⇒ Object
93
94
95
96
97
98
99
|
# File 'lib/y2r/ast/ruby.rb', line 93
def to_ruby(context)
context do ||
wrap_code_with_parens do |parens_context|
to_ruby_base(parens_context)
end
end
end
|