I have a ruby variable 'is_published'. I want to convert the value in 'is_published' to integer. Is there any method in ruby to do that?
if is_published == true
is_published = 1
else
is_published = 0
end
The above code works perfectly. Please help if there is any way to do this in a single line code.