Methods vs constants for static values in Ruby
22-Aug-2019 2546
Recently, I’ve been part of a team that stumbled upon rewriting a legacy library into a new, refreshed API. That API would serve as a foundation for long-term development, so we’ve put some time to design it well.We’ve had to agree on many aspects of the API design, and one of them was how we want to define static values. Even for something as simple as a name of reserved queue (in case you’re building a job framework), there’s at least 3 ways to define it:.
Methods vs constants for static values in Ruby #ruby #rubydeveloper #rubyonrails #Methods #constants #static #values https://rubyonrails.ba/link/methods-vs-constants-for-static-values-in-ruby