Ruby: Parameterising with ActiveResource
We’ve been using Ruby/Rails on my current project to create a RESTful web service. One of the problems we wanted to solve was making the data queried by this web service configurable from our build.
We started off with the following bit of code (which makes use of the recently added ActiveResource class):
123~ </td> | class MyClass < ActiveResource::[.co]Base self.site = [.dl]"[.k]#http://localhost:3000/[.dl]"[.r]#end~ </td> </tr> </tbody></table> And then called this class as follows: |
About the author
I'm currently working on short form content at ClickHouse. I publish short 5 minute videos showing how to solve data problems on YouTube @LearnDataWithMark. I previously worked on graph analytics at Neo4j, where I also co-authored the O'Reilly Graph Algorithms Book with Amy Hodler.