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
poolparty-1.6.8 lib/poolparty/pool_party_error.rb
poolparty-1.6.7 lib/poolparty/pool_party_error.rb
poolparty-1.6.6 lib/poolparty/pool_party_error.rb
poolparty-1.6.5 lib/poolparty/pool_party_error.rb
poolparty-1.6.4 lib/poolparty/pool_party_error.rb
poolparty-1.6.3 lib/poolparty/pool_party_error.rb
poolparty-1.6.2 lib/poolparty/pool_party_error.rb
poolparty-1.6.1 lib/poolparty/pool_party_error.rb
poolparty-1.6.0 lib/poolparty/pool_party_error.rb
poolparty-1.5.0 lib/poolparty/pool_party_error.rb
poolparty-1.4.8 lib/poolparty/pool_party_error.rb
poolparty-1.4.7 lib/poolparty/pool_party_error.rb
poolparty-1.4.6 lib/poolparty/pool_party_error.rb
poolparty-1.4.5 lib/poolparty/pool_party_error.rb
poolparty-1.4.4 lib/poolparty/pool_party_error.rb
poolparty-1.4.3 lib/poolparty/pool_party_error.rb
poolparty-1.4.2 lib/poolparty/pool_party_error.rb
poolparty-1.4.1 lib/poolparty/pool_party_error.rb
poolparty-1.4.0 lib/poolparty/pool_party_error.rb
poolparty-1.3.15 lib/poolparty/pool_party_error.rb