spec/support/test_resource_classes.rb in survey-gizmo-ruby-1.0.5 vs spec/support/test_resource_classes.rb in survey-gizmo-ruby-2.0.0
- old
+ new
@@ -1,42 +1,25 @@
module SurveyGizmoSpec
class ResourceTest
include SurveyGizmo::Resource
-
+
attribute :id, Integer
attribute :title, String
attribute :test_id, Integer
-
+
# routes
route '/test/:id', :via => :get
route '/test/:test_id/resource', :via => :create
route '/test/:test_id/resource/:id', :via => [:update, :delete]
-
- def to_param_options
- {:id => self.id, :test_id => self.test_id}
- end
- end
- class CollectionTest
- include SurveyGizmo::Resource
-
- attribute :id, Integer
- attribute :title, String
-
- # routes
- route '/test/:id', :via => :get
- route '/test/collection', :via => :create
- route '/test/collection/:id', :via => [:update, :delete]
-
def to_param_options
- {:id => self.id, :test_id => self.test_id}
+ {id: self.id, test_id: self.test_id}
end
end
class GenericResource
include SurveyGizmo::Resource
-
+
attribute :id, Integer
attribute :title, String
-
end
end
\ No newline at end of file