Class: Jeweler::Service
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#fatals ⇒ Object
Returns the value of attribute fatals.
-
#result ⇒ Object
Returns the value of attribute result.
-
#result_message ⇒ Object
Returns the value of attribute result_message.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
7 8 9 |
# File 'lib/jeweler/service.rb', line 7 def errors @errors end |
#fatals ⇒ Object
Returns the value of attribute fatals.
7 8 9 |
# File 'lib/jeweler/service.rb', line 7 def fatals @fatals end |
#result ⇒ Object
Returns the value of attribute result.
7 8 9 |
# File 'lib/jeweler/service.rb', line 7 def result @result end |
#result_message ⇒ Object
Returns the value of attribute result_message.
7 8 9 |
# File 'lib/jeweler/service.rb', line 7 def @result_message end |
Class Method Details
.call(*args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/jeweler/service.rb', line 9 def self.call(*args) new(*args).tap do |service| service.instance_variable_set('@errors', Array.new) service.instance_variable_set('@fatals', Array.new) service.instance_variable_set('@result_message', '') service.instance_variable_set("@result", service.call) tapped_errors = service.instance_variable_get('@errors') tapped_fatals = service.instance_variable_get('@fatals') first_fatal = true tapped_fatals.each do |fatal| Rails.logger.error 'ServiceObject Fatal Error: ' + fatal if first_fatal tapped_errors << 'There was an error. Contact Support.' first_fatal = false end end service.instance_variable_set('@errors', tapped_errors) end end |
Instance Method Details
#call ⇒ Object
35 36 37 |
# File 'lib/jeweler/service.rb', line 35 def call raise NotImplementedError end |