Created a lib directory and added entity_resource.rb as well as query_resource.rb.

This commit is contained in:
Yannick 2014-07-09 15:22:43 -06:00
parent f0b7703950
commit 7837013d14
2 changed files with 17 additions and 0 deletions

7
lib/entity_resource.rb Normal file
View File

@ -0,0 +1,7 @@
require 'active_resource'
class EntityResource < ActiveResource::Base
self.site ='http://localhost:3000'
self.element_name = "entity"
end

10
lib/query_resource.rb Normal file
View File

@ -0,0 +1,10 @@
require 'active_resource'
class QueryResource < ActiveResource::Base
self.site ='http://localhost:3000'
self.element_name = "query"
has_many :entities, class_name: 'EntityResource'
def to_param
self.identifier
end
end