Class: Peddler::Errors::Builder Private

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/peddler/errors/builder.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Builder.



14
15
16
# File 'lib/peddler/errors/builder.rb', line 14

def initialize
  @mutex = Mutex.new
end

Class Method Details

.build(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
# File 'lib/peddler/errors/builder.rb', line 10

def self.build(name)
  instance.build(name)
end

Instance Method Details

#build(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
21
22
23
# File 'lib/peddler/errors/builder.rb', line 18

def build(name)
  with_mutex do
    return Errors.const_get(name) if Errors.const_defined?(name)
    Errors.const_set(name, Class.new(Error))
  end
end