hyperresource icon indicating copy to clipboard operation
hyperresource copied to clipboard

'name' property lost

Open mynameisrufus opened this issue 10 years ago • 2 comments

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

mynameisrufus avatar Mar 20 '15 02:03 mynameisrufus

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

brencoder avatar Aug 13 '15 05:08 brencoder

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

mynameisrufus avatar Aug 13 '15 06:08 mynameisrufus