Created
December 16, 2011 18:41
-
-
Save pezra/1487341 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Account | |
include HalRepresentation | |
property :name, String | |
association :members, array_of(User), rel: "http://example.com/api/rels/members" | |
end | |
a = Account.get('http://example.com/accounts/42') | |
a.name = "New name" | |
a.save # sends put of hal representation of Account to the self url | |
a.members # => [#<User:2342>,#<User:34242>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment