Commit 33dc921e authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Use the Ruby Singleton class inside Util::Singleton.

Although our simple implementation worked also just fine, the builtin
Singleton has some more checks built into it - just good to rely on
something that's well tried and tested.
parent 4aa9b9ee
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
require 'singleton'

module JsDuck
  module Util
@@ -20,9 +21,7 @@ module JsDuck
    module Singleton
      def self.included(base)
        base.class_eval do
          def self.instance
            @instance ||= self.new
          end
          include ::Singleton

          # Redirect calls from MyClass.method to MyClass.instance.method
          def self.method_missing(meth, *args, &block)