I am trying to learn Ruby and I have read the picax book at least twice and
seems to understand most of what is said in the book. Now I am reading
through some of the code written that I down loaded. I saw some code that I
wanted someone to explain to me.
module HL7 # :nodoc:
VERSION = "0.1.%s" % "$Rev: 23 $".gsub(/\$Rev:\s+/, '').gsub(/\s*\$$/, '')
end
# Encapsulate HL7 specific exceptions
class HL7::Exception < StandardError
end
# Parsing failed
class HL7::ParseError < HL7::Exception
end
Explain to me how to use the "::" operator. It seems the author is defining
a Class called HL7::Exception? The syntax for class definition is Class
Name.
-----Original Message-----
From: Mac Pat [mailto:pat.mac5453@gmail.com]
Sent: Sunday, July 29, 2007 3:05 PM
To: ruby-talk ML
Subject: nubie question
I am trying to learn Ruby and I have read the picax book at
least twice and seems to understand most of what is said in
the book. Now I am reading through some of the code written
that I down loaded. I saw some code that I wanted someone to
explain to me.
module HL7 # :nodoc:
VERSION = "0.1.%s" % "$Rev: 23 $".gsub(/\$Rev:\s+/,
'').gsub(/\s*\$$/, '') end
# Encapsulate HL7 specific exceptions
class HL7::Exception < StandardError
end
# Parsing failed
class HL7::ParseError < HL7::Exception
end
Explain to me how to use the "::" operator. It seems the
author is defining a Class called HL7::Exception? The syntax
for class definition is Class Name.