Ask A Question

Notifications

You’re not receiving notifications from this thread.

Adding an extra method to an API wrapper

Dean Perry asked in Gems / Libraries

Hey! I've been following the API wrapper series and I've got my Gem pretty much ready to go. There's a few areas of the API which I'd like to make easier and I'm trying to work out how to do this.

In the API there's a createdAt field in this format: 1635031167000. Trying to convert this with Time.at throws an error so I'd like to add a created_at field in this Object method, which parses it properly as Time.at(completedAt.to_s[0..-4].to_i), but I can't work out how to add it to the OpenStruct.

Any help would be appreciated!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,464+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.