about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-23 15:21:55 -0800
committerEric Wong <normalperson@yhbt.net>2011-02-23 16:08:09 -0800
commit0d3f4d41cedc59c4b3cf000f0e05bc1245be8ad3 (patch)
tree12e2113815ab74ea4dd0f80cc5a39322f1273fa6 /lib
parentb6d82cdeff1ea2822c2911adf61d6a00538ecba8 (diff)
downloadruby_posix_mq-0d3f4d41cedc59c4b3cf000f0e05bc1245be8ad3.tar.gz
No need to waste indentation and make eyes wander.
Diffstat (limited to 'lib')
-rw-r--r--lib/posix_mq.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/posix_mq.rb b/lib/posix_mq.rb
index e07fe1f..02a646d 100644
--- a/lib/posix_mq.rb
+++ b/lib/posix_mq.rb
@@ -12,19 +12,16 @@ class POSIX_MQ
   # See the mq_getattr(3) manpage for more information on the values.
   Attr = Struct.new(:flags, :maxmsg, :msgsize, :curmsgs)
 
-  class << self
-
-    # Opens a POSIX message queue and performs operations on the
-    # given block, closing the message queue at exit.
-    # All all arguments are passed to POSIX_MQ.new.
-    def open(*args)
-      mq = new(*args)
-      block_given? or return mq
-      begin
-        yield mq
-      ensure
-        mq.close unless mq.closed?
-      end
+  # Opens a POSIX message queue and performs operations on the
+  # given block, closing the message queue at exit.
+  # All all arguments are passed to POSIX_MQ.new.
+  def self.open(*args)
+    mq = new(*args)
+    block_given? or return mq
+    begin
+      yield mq
+    ensure
+      mq.close unless mq.closed?
     end
   end