Skip to content

Coder Tutorial

Menu
  • Home
  • HTML
  • CSS
  • PHP
  • SQL
  • MySQL
  • JS
  • PL/SQL
  • Python
  • Java
  • Oracle
Home
Ruby
Ruby Return statement

Ruby Return statement

Ruby Return statement

The Ruby Return statement in method syntax and example.

Return syntax

while condition
	-- Ruby code 
end
--or
begin
	-- Ruby code 
end while condition

Return example

def test
   a = 1
   b = 2
   c = 3
   d = "xyz"
return a, b, c, d
end
puts test

Output

1

2

3

xyz

Tutorials

  • Ruby Tutorial
  • Ruby Variables
  • Ruby Strings
  • Ruby Date and Time
  • Ruby Array
  • Ruby Hashes
  • Ruby Ranges
  • Ruby If-Elsif-Else
  • Ruby Case
  • Ruby For Loop
  • Ruby While Loop
  • Ruby Until Loop
  • Ruby Each Loop
  • Ruby Next Statement
  • Ruby Break Statement
  • Ruby Return statement
  • Ruby Methods
  • Ruby Blocks
  • Ruby Exceptions

Recent Posts

  • Java Polymorphism
  • Java Encapsulation
  • Java Abstraction
  • PostgreSQL ERROR: cannot begin/end transactions in PL/pgSQL
  • PostgreSQL Column must appear in the GROUP BY clause
  • PostgreSQL Column specified more than once
  • PostgreSQL Create database, Alter database examples
  • PostgreSQL Create schema syntax, Alter schema
  • PostgreSQL Create database user, alter and drop username
  • PostgreSQL Alter table name. Modify column name
Coder Tutorial Copyright © 2025. | Privacy Policy
Back to Top ↑