easy_api_operations 0.1.1 → 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d37e8fee6cfdb0688816b209303c051756486ea2
4
- data.tar.gz: fa06caab4a7f4ccf9937881abfec62d16298cce5
3
+ metadata.gz: ab6d1c22d06a5a21ac4db90882ff0a5d70a0c7db
4
+ data.tar.gz: a2a837efe6083c69341beed99412d434914b9d1f
5
5
  SHA512:
6
- metadata.gz: b55dd4119e00616a38e448995e11741a48122a3f4bd175a1a0db4950a1cdfef52f8e8aadf982cd6b465f62ac19b365dcb7bc91374de404039e637d4ecd031066
7
- data.tar.gz: abbf2f789630801603718ddeb81ab9f6dad4344b6b91d758b64eab8d53721779585f11b350da41cac768139262fac9a08a550b284afa9e1f28a967f7ef129abe
6
+ metadata.gz: 25620350a4a9b9a1038eedb22106a6025aefcc8daf0e1a628b9bf44b3c6ba280a84e0c41ef7bc9b97cff4acee249e683d2a17bf45a34db3c6c8df84fb3b9b4cf
7
+ data.tar.gz: 0fe419228fbf00238cf4c3c6dd77443b0301519c1d9f001955b594e288640f9159d0bbb5914e878333aaf6c92cca1a26965c522d16ce70029ef918d0193782c7
@@ -1,3 +1,3 @@
1
1
  module EasyApiOperations
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2"
3
3
  end
@@ -1,4 +1,4 @@
1
- require "easy_api_operations/version"
1
+ # require "easy_api_operations/version"
2
2
 
3
3
  module EasyApiOperations
4
4
  def self.set_up_api(api, ressource_name, operations)
@@ -26,7 +26,6 @@ module EasyApiOperations
26
26
  #(api_version + "::Entities::" + ressource_name + "CreateBody").constantize == API::V1::Entities::AppointmentCreateBody
27
27
  #ressource_name.constantize == Appointment
28
28
 
29
-
30
29
  #___________ressource plural start
31
30
  if operations.include?("plural") or operations.include?("all")
32
31
  api.resource ressource_name.downcase.pluralize.to_sym do
@@ -34,7 +33,7 @@ module EasyApiOperations
34
33
  #___________get_______________start__________________
35
34
  #!!!description + params that can be requested -> currently the same as the once you get back, this can be adjusted (see other possibilities at the end)
36
35
  if operations.include?("plural_get") or operations.include?("all")
37
- desc "Returns a list of #{ressource_name}. Limited by 1000", params: (api_version + "::Entities::" + ressource_name.pluralize).constantize.documentation#, entity: API::V1::Entities::Appointments
36
+ desc "Returns a list of #{ressource_name}. Limited by 1000", params: (api_version + "::Entities::" + ressource_name.pluralize).constantize.documentation, entity: (api_version + "::Entities::" + ressource_name.pluralize).constantize#, entity: API::V1::Entities::Appointments
38
37
  get do
39
38
  if params.empty?
40
39
  present "Choose something dude"
@@ -68,7 +67,7 @@ module EasyApiOperations
68
67
 
69
68
  #___________get_______________start__________________
70
69
  if operations.include?("singular_get") or operations.include?("all")
71
- desc "Returns #{ressource_name.indefinitize} by #{ressource_name.constantize.primary_key}"
70
+ desc "Returns #{ressource_name.indefinitize} by #{ressource_name.constantize.primary_key}", entity: (api_version + "::Entities::" + ressource_name).constantize
72
71
  params do
73
72
  requires ressource_name.constantize.primary_key, type: Integer, desc: "#{ressource_name} #{ressource_name.constantize.primary_key}"
74
73
  end
@@ -84,7 +83,7 @@ module EasyApiOperations
84
83
  end
85
84
  #___________put_______________start__________________
86
85
  if operations.include?("singular_put") or operations.include?("all")
87
- desc "Updates #{ressource_name.indefinitize} by #{ressource_name.constantize.primary_key}"
86
+ desc "Updates #{ressource_name.indefinitize} by #{ressource_name.constantize.primary_key}", entity: (api_version + "::Entities::" + ressource_name + "UpdateBody").constantize
88
87
  params do
89
88
  #!!!no need to require the primary_key as it is requested within the body already, change the body, change this part
90
89
  #requires Appointment.primary_key, type: String, desc: "Appointment #{Appointment.primary_key}"
@@ -138,7 +137,7 @@ module EasyApiOperations
138
137
 
139
138
  #___________create_______________start__________________
140
139
  if operations.include?("singular_post") or operations.include?("all")
141
- desc "Creates #{ressource_name.indefinitize}"#, entity: API::V1::Entities::Appointments
140
+ desc "Creates #{ressource_name.indefinitize}", entity: (api_version + "::Entities::" + ressource_name + "CreateBody").constantize#, entity: API::V1::Entities::Appointments
142
141
  params do
143
142
  optional :body, type: (api_version + "::Entities::" + ressource_name + "CreateBody").constantize, desc: "Body to create #{"Appointment".indefinitize}"
144
143
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_api_operations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bjoern Moeller / Christian Hentke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-06 00:00:00.000000000 Z
11
+ date: 2016-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler