This is ruby function :
def long_reference_name
if suite?
"#{recursive_access} #{recursive_view} "
else
""
end + reference_name
end
I don't understand what's the meaning of:
end + reference_name
It’s not end + reference_name
, it’s <previous expression> + reference_name
, where <previous_expression>
is:
if suite?
"#{recursive_access} #{recursive_view} "
else
""
end
Because blocks are expressions with values in Ruby.
In other words, you have either "#{recursive_access} #{recursive_view} " + reference_name
or "" + reference_name
, depending on the value of suite?
.
This is method +
called on result of if-else-end
statement.
As an example see below :
m = if true
"abc"
else
"xyz"
end + "mm"
# => "abcmm"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With