Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More complete examples? #192

Closed
Sinetheta opened this issue May 23, 2016 · 3 comments
Closed

More complete examples? #192

Sinetheta opened this issue May 23, 2016 · 3 comments

Comments

@Sinetheta
Copy link

Hey guys, I've been poking around this gem for some time now, but still having trouble figuring out the API.

Making the requests from the examples folder works fine, and calling client.metadata also appears to make a request and populate the client with some info. But how does one then take advantage of that?

client.find appears to return simple hashes, how is one supposed to use the metadata to expand on properties like "OwnershipType"=>"3"?

@dougcole
Copy link
Contributor

Hi @Sinetheta, .find takes a second argument of an options hash. One of the options is :resolve, which if set to true will decode compact results. The other way to approach the problem is let the RETS server decode on their side by using the option `:format => 'COMPACT-DECODED'.

Sorry our examples are so sparse, if you have time and want to help add to them that'd be great! We have some documentation inline, which should also help. For example here is the documentation for .find: https://github.com/estately/rets/blob/master/lib/rets/client.rb#L53-L71

@Sinetheta
Copy link
Author

Thanks @dougcole, I thought I tried resolve: true and still got back an array of hashes, but maybe that's related to the fact that my metadata (although fetching and parsing correctly) doesn't seem to be persisted to disk even when I use the file cache.

@dougcole
Copy link
Contributor

Sorry @Sinetheta, sounds frustrating! resolve should work even if the metadata isn't persisted to disk, it'll just download it again if it isn't available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants