Your SlideShare is downloading. ×
Ruby
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Ruby

712
views

Published on

* About this Tutorial …

* About this Tutorial
* Hello World
* Loops
* Branching
* Containers
* Arrays
* Hashes
* Strings
* Regular Expressions
* Subroutines
* Exceptions
* Terminal IO
* File IO
* How OOP is Ruby?
* Object Oriented Programming Concepts
* Simple OOP in Ruby

Published in: Technology, Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
712
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Socket classes Ruby has a rich and diverse set of sockets classes. These classes range from the standard Socket class to more refined classes that focus on a particular protocol or application type. The class hierarchy of the base sockets classes is as shown below:
  • 2. Most of the classes derive from the IO class. This means that we can use the methods of IO that are so familiar to us. The TCPSocket class supports sockets for the connection-based, reliable Transmission Control Protocol. A helper class for the creation of TCP server sockets is also available in the TCPServer class. To create a stream socket and connect it to a server, the TCPSocket class can be used. All socket classes are part of the standard library (and not part of the core classes), so to use them in your Ruby program, you must first write: require 'socket'
  • 3. SMTP Class E-mail is still one of the most important and popular technologies used online. require 'net/smtp' user_from = "superman@world.com" user_to = "batman@world.com" msg= “How are you?" # handling exceptions begin Net::SMTP.start('localhost', 25) do |smtpclient| smtpclient.send_message(msg, user_from, user_to) end rescue Exception => e print "Exception occured: " + e end The Net::SMTP library provides functionality to send internet mail via SMTP, the Simple Mail Transfer Protocol.
  • 4. Ruby on Rails Introduction
    • Ruby on Rails, often shortened to Rails or RoR.
    • Open source web application framework for the Ruby programming language.
    • Written in Ruby by David Heinemeier Hansson.
    • You could develop a web application at least ten times faster with Rails than you could with a typical Java framework.