@XStreamAlias("local")
public class Local implements HypermediaResource {
// gets and sets
public void configureRelations( RelationBuilder builder ) {
builder.relation( "self" ).uses( LocalController.class ).get( id );
}
}
resource.links.self
current = Restfulie.at('http://localhost:8080/context/locals/1').accepts("application/xml").get
# ...
current.resource
# => { "local" =>
# { "id" =>"1",
# "description"=>"Testing",
# "status"=>"A",
# "user"=>"1228",
# "created"=>"2013-01-31 15:37:18.0",
# "updated"=>"2013-01-31 15:37:18.0",
# "link"=>[
# { "rel"=>"self",
# "href"=>"http://localhost:8080/context/locals/1",
# "xmlns:atom"=>"http://www.w3.org/2005/Atom"}
# ]
# }}
# response.resource doesn't returning local object
local = response.resource['local']
local.links
# => nil
local.link('self')
# => [{"rel"=>"self", "href"=>"http://localhost:8080/context/locals/1", "xmlns:atom"=>"http://www.w3.org/2005/Atom"}]
--
---
You received this message because you are subscribed to the Google Groups "restfulie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to restfulie+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi fabiano.
Where is the responses variante coming from in your Last example?
Regards
1.9.3p194 :001 > current = Restfulie.at('http://localhost:8080/contest/locals/1').accepts("application/xml").get
#=> ready to execute request using stack [{:type=>Restfulie::Client::Feature::BaseRequest, :args=>[]}, {:type=>Restfulie::Client::Feature::RescueException, :args=>[]}, {:type=>Restfulie::Client::Feature::SetupHeader, :args=>[]}, {:type=>Restfulie::Client::Feature::SerializeBody, :args=>[]}, {:type=>Restfulie::Client::Feature::EnhanceResponse, :args=>[]}, {:type=>Restfulie::Client::Feature::FollowRequest, :args=>[]}]
#=> invoking filter Restfulie::Client::Feature::FollowRequest with #<Restfulie::Client::Dsl:0x007fa8d3aed7c8> at {}
#=> invoking filter Restfulie::Client::Feature::EnhanceResponse with #<Restfulie::Client::Dsl:0x007fa8d3aed7c8> at {}
#=> invoking filter Restfulie::Client::Feature::SerializeBody with #<Restfulie::Client::Dsl:0x007fa8d3aed7c8> at {}
#=> invoking filter Restfulie::Client::Feature::SetupHeader with #<Restfulie::Client::Dsl:0x007fa8d3aed7c8> at {}
#=> invoking filter Restfulie::Client::Feature::RescueException with #<Restfulie::Client::Dsl:0x007fa8d3aed7c8> at {}
#=> invoking filter Restfulie::Client::Feature::BaseRequest with #<Restfulie::Client::Dsl:0x007fa8d3aed7c8> at {}
#=> GET /context/locals/1
#=> #<Net::HTTPOK 200 OK readbody=true>
=> #<Net::HTTPOK 200 OK readbody=true>
1.9.3-p194 :007 > current = Restfulie.at('http://localhost:8080/context/locals/1').accepts("application/xml").get
#=> ready to execute request using stack [{:type=>Restfulie::Client::Feature::BaseRequest, :args=>[]}, {:type=>Restfulie::Client::Feature::RescueException, :args=>[]}, {:type=>Restfulie::Client::Feature::SetupHeader, :args=>[]}, {:type=>Restfulie::Client::Feature::SerializeBody, :args=>[]}, {:type=>Restfulie::Client::Feature::EnhanceResponse, :args=>[]}, {:type=>Restfulie::Client::Feature::FollowRequest, :args=>[]}]
#=> invoking filter Restfulie::Client::Feature::FollowRequest with #<Restfulie::Client::Dsl:0x007fe03f40a098> at {}
#=> invoking filter Restfulie::Client::Feature::EnhanceResponse with #<Restfulie::Client::Dsl:0x007fe03f40a098> at {}
#=> invoking filter Restfulie::Client::Feature::SerializeBody with #<Restfulie::Client::Dsl:0x007fe03f40a098> at {}
#=> invoking filter Restfulie::Client::Feature::SetupHeader with #<Restfulie::Client::Dsl:0x007fe03f40a098> at {}
#=> invoking filter Restfulie::Client::Feature::RescueException with #<Restfulie::Client::Dsl:0x007fe03f40a098> at {}
#=> invoking filter Restfulie::Client::Feature::BaseRequest with #<Restfulie::Client::Dsl:0x007fe03f40a098> at {}
#=> GET /genhio/localidades/1
=> #<Net::HTTPOK 200 OK readbody=true>
1.9.3-p194 :008 > current.resource
=> {"local"=>{"id"=>"1", "description"=>"Test", "status"=>"A", "userCreated"=>"594", "createdAt"=>"2013-02-19 15:00:56.0", "userUpdated"=>"594", "updatedAt"=>"2013-02-19 15:00:56.0", "link"=>[{"rel"=>"self", "href"=>"http://localhost:8080/context/locals/1", "xmlns:atom"=>"http://www.w3.org/2005/Atom"}, {"rel"=>"locais", "href"=>"http://localhost:8080/context/locals/1/all", "xmlns:atom"=>"http://www.w3.org/2005/Atom"}]}}