Class: Peddler::Errors::Builder Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ Builder

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.



25
26
27
# File 'lib/peddler/errors/builder.rb', line 25

def initialize(error)
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

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.



23
24
25
# File 'lib/peddler/errors/builder.rb', line 23

def error
  @error
end

Class Method Details

.call(error) ⇒ 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.



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

def self.call(error)
  new(error).build
end

Instance Method Details

#buildObject

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.



29
30
31
32
33
# File 'lib/peddler/errors/builder.rb', line 29

def build
  parse_original_response
  return if bad_class_name?
  error_class.new(error_message, error)
end