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

'name' property lost #36

Open
mynameisrufus opened this issue Mar 20, 2015 · 2 comments
Open

'name' property lost #36

mynameisrufus opened this issue Mar 20, 2015 · 2 comments

Comments

@mynameisrufus
Copy link

Given the following node:

{
  "name": "foo"
}
#<HyperResource::Link:0x007f8d8644b978
 @base_href="/api/nodes/e22d486a-f2cc-4ecf-8659-617cd80cf41f",
 @default_method="get",
 @name=nil,
 @params={},
 @resource=
  #<HyperResource:0x3fc6c32651dc @root="http://trowel.dev/api" @href="/api/nodes" @loaded=true @namespace=nil ...>,
 @templated=false>

node.name and node['name'] both return nil

@brencoder
Copy link

Just repeating what you mentioned to me earlier - you can obtain the value that you assigned to the name field through node.attributes['name'].

@mynameisrufus
Copy link
Author

That's correct, I think it might be worth changing the name to @_name, Rspec approaches it this way I think.

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