Sha256: bfa30ef5a191cacc6495ad736d7ea56b1153376b782626bb35250cf236ba715d

Contents?: true

Size: 563 Bytes

Versions: 48

Compression:

Stored size: 563 Bytes

Contents

=begin rdoc
  PoolPartyError
  
  Create an StandardError on the fly
=end
module PoolParty
  class PoolPartyError
    
    # Create an error with the class_name and error message
    # If the StandardError is not yet defined, define it, subclassing
    # StandardError and return the new class
    # Note: the class is set on Object
    def self.create(class_name="StandardError", msg="Error")
      Object.const_set(class_name, Class.new(StandardError)) unless Object.const_defined?(class_name)
      class_name.constantize.send(:new, msg)
    end
    
  end
end

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
auser-poolparty-1.3.0 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.1 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.10 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.11 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.12 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.13 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.14 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.15 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.16 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.17 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.2 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.3 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.4 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.5 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.6 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.7 lib/poolparty/pool_party_error.rb
auser-poolparty-1.3.8 lib/poolparty/pool_party_error.rb
fairchild-poolparty-1.3.17 lib/poolparty/pool_party_error.rb
fairchild-poolparty-1.3.5 lib/poolparty/pool_party_error.rb
poolparty-1.6.9 lib/poolparty/pool_party_error.rb