module Orbit::Singleton

Public Class Methods

included(base) click to toggle source
# File lib/orbit/singleton.rb, line 3
def self.included(base)
    base.extend(ClassMethods)
end

Public Instance Methods

instantiate() click to toggle source
# File lib/orbit/singleton.rb, line 7
def instantiate
  raise ArgumentError.new("Cannot instantiate a Singleton twice") if self.class.instantiated?

  self.class.instance = self
end