Rails procedure design pattern
01-Oct-2020 1853
The class, defined above, itself is quite readable and the usage is pretty simple. It's a typical representation of the policy object pattern where the main goal of the class is to return boolean value and do not perform any complex action besides comparing and checking the values.Now imagine that we would like to tell the user why he is not able to pull the report. We would have to rebuild our policy object and create some class that would check exactly which step of verification failed and prepare a proper message. This is the perfect scenario where the procedure design pattern can be used.
Rails procedure design pattern #ruby #rubydeveloper #rubyonrails #Rails #procedure #design #pattern https://www.rubyonrails.ba/link/rails-procedure-design-pattern