rest_model 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/.gitignore +5 -0
  2. data/Gemfile +2 -0
  3. data/Guardfile +7 -0
  4. data/README.md +237 -0
  5. data/Rakefile +2 -0
  6. data/examples/all.rb +12 -0
  7. data/examples/embeds_many/invisible.rb +16 -0
  8. data/examples/embeds_many/simple.rb +13 -0
  9. data/examples/embeds_many/with_array.rb +10 -0
  10. data/examples/embeds_many/with_class_name.rb +13 -0
  11. data/examples/embeds_many/with_fields.rb +9 -0
  12. data/examples/embeds_many/with_if.rb +16 -0
  13. data/examples/embeds_many/with_nil_value.rb +12 -0
  14. data/examples/embeds_many/with_start_key.rb +13 -0
  15. data/examples/embeds_one/flattened.rb +12 -0
  16. data/examples/embeds_one/simple.rb +12 -0
  17. data/examples/embeds_one/with_class_name.rb +12 -0
  18. data/examples/embeds_one/with_if.rb +16 -0
  19. data/examples/embeds_one/with_start_key.rb +12 -0
  20. data/examples/has_many/simple.rb +28 -0
  21. data/examples/helper.rb +9 -0
  22. data/examples/initialize/embeds_many.rb +25 -0
  23. data/examples/initialize/embeds_many_array.rb +9 -0
  24. data/examples/initialize/embeds_one.rb +19 -0
  25. data/examples/initialize/simple.rb +8 -0
  26. data/examples/properties/array_serialization.rb +8 -0
  27. data/examples/properties/collections.rb +11 -0
  28. data/examples/properties/simple.rb +8 -0
  29. data/examples/properties/with_field.rb +8 -0
  30. data/examples/properties/with_field_path.rb +8 -0
  31. data/examples/properties/with_id.rb +8 -0
  32. data/examples/properties/with_if.rb +21 -0
  33. data/examples/properties/with_key_converter.rb +18 -0
  34. data/examples/properties/with_two_key_converters.rb +27 -0
  35. data/examples/properties/with_values.rb +10 -0
  36. data/examples/summarization/simple.rb +21 -0
  37. data/examples/to_input/embeds_many.rb +25 -0
  38. data/examples/to_input/embeds_many_without_key.rb +31 -0
  39. data/examples/to_input/embeds_one.rb +13 -0
  40. data/examples/to_input/embeds_one_without_key.rb +23 -0
  41. data/examples/to_input/flattened.rb +12 -0
  42. data/examples/to_input/serializables.rb +19 -0
  43. data/examples/to_input/simple.rb +8 -0
  44. data/examples/to_input/with_field.rb +8 -0
  45. data/examples/to_input/with_field_path.rb +8 -0
  46. data/examples/to_input/with_fields.rb +8 -0
  47. data/examples/to_input/without_key.rb +11 -0
  48. data/examples/to_input/without_nil.rb +11 -0
  49. data/lib/rest_model/configuration.rb +45 -0
  50. data/lib/rest_model/key/association.rb +42 -0
  51. data/lib/rest_model/key/builder.rb +30 -0
  52. data/lib/rest_model/key/embeddable/builder.rb +19 -0
  53. data/lib/rest_model/key/embeddable/response.rb +25 -0
  54. data/lib/rest_model/key/embeddable/retriever.rb +20 -0
  55. data/lib/rest_model/key/embeddable/sender.rb +41 -0
  56. data/lib/rest_model/key/embeddable.rb +29 -0
  57. data/lib/rest_model/key/href/response.rb +10 -0
  58. data/lib/rest_model/key/href.rb +10 -0
  59. data/lib/rest_model/key/property/builder.rb +27 -0
  60. data/lib/rest_model/key/property/response.rb +9 -0
  61. data/lib/rest_model/key/property/retriever.rb +24 -0
  62. data/lib/rest_model/key/property/sender.rb +41 -0
  63. data/lib/rest_model/key/property.rb +22 -0
  64. data/lib/rest_model/key/relation/builder.rb +24 -0
  65. data/lib/rest_model/key/relation/response.rb +38 -0
  66. data/lib/rest_model/key/relation.rb +23 -0
  67. data/lib/rest_model/key.rb +44 -0
  68. data/lib/rest_model/response.rb +42 -0
  69. data/lib/rest_model/serialization/boolean.rb +48 -0
  70. data/lib/rest_model/serialization/date.rb +19 -0
  71. data/lib/rest_model/serialization/enumerable.rb +15 -0
  72. data/lib/rest_model/serialization/float.rb +17 -0
  73. data/lib/rest_model/serialization/integer.rb +17 -0
  74. data/lib/rest_model/serialization/string.rb +13 -0
  75. data/lib/rest_model/source/path.rb +25 -0
  76. data/lib/rest_model/source/retriever.rb +48 -0
  77. data/lib/rest_model/source/sender.rb +38 -0
  78. data/lib/rest_model/version.rb +3 -0
  79. data/lib/rest_model.rb +101 -0
  80. data/rest_model.gemspec +26 -0
  81. data/spec/.DS_Store +0 -0
  82. data/spec/integration/embeds_many_spec.rb +57 -0
  83. data/spec/integration/embeds_one_spec.rb +41 -0
  84. data/spec/integration/has_many_spec.rb +27 -0
  85. data/spec/integration/property_spec.rb +69 -0
  86. data/spec/integration/summarization_spec.rb +12 -0
  87. data/spec/spec_helper.rb +26 -0
  88. data/spec/support/examples.rb +29 -0
  89. data/spec/support/out.rb +17 -0
  90. data/spec/support/shared_examples.rb +20 -0
  91. data/spec/unit/configuration_spec.rb +24 -0
  92. data/spec/unit/key/association_spec.rb +69 -0
  93. data/spec/unit/key/embeddable/builder_spec.rb +26 -0
  94. data/spec/unit/key/embeddable/response_spec.rb +55 -0
  95. data/spec/unit/key/embeddable/retriever_spec.rb +38 -0
  96. data/spec/unit/key/embeddable_spec.rb +7 -0
  97. data/spec/unit/key/property/builder_spec.rb +154 -0
  98. data/spec/unit/key/property/response_spec.rb +22 -0
  99. data/spec/unit/key/property/retriever_spec.rb +31 -0
  100. data/spec/unit/key/property_spec.rb +39 -0
  101. data/spec/unit/key/relation/builder_spec.rb +53 -0
  102. data/spec/unit/key/relation/response_spec.rb +105 -0
  103. data/spec/unit/key/relation_spec.rb +71 -0
  104. data/spec/unit/key_spec.rb +101 -0
  105. data/spec/unit/response_spec.rb +44 -0
  106. data/spec/unit/rest_model_spec.rb +46 -0
  107. data/spec/unit/serialization/boolean_spec.rb +25 -0
  108. data/spec/unit/serialization/date_spec.rb +13 -0
  109. data/spec/unit/serialization/float_spec.rb +13 -0
  110. data/spec/unit/serialization/integer_spec.rb +13 -0
  111. data/spec/unit/serialization/string_spec.rb +11 -0
  112. data/spec/unit/source/path_spec.rb +62 -0
  113. data/spec/unit/source/retriever_spec.rb +85 -0
  114. metadata +260 -0
metadata ADDED
@@ -0,0 +1,260 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rest_model
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Victor Rodrigues
9
+ - Vinicius Higa
10
+ - William Yokoi
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2011-10-04 00:00:00.000000000Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: activesupport
18
+ requirement: &70114893435640 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: '3.0'
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: *70114893435640
27
+ - !ruby/object:Gem::Dependency
28
+ name: i18n
29
+ requirement: &70114893432760 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0.5'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: *70114893432760
38
+ - !ruby/object:Gem::Dependency
39
+ name: rspec
40
+ requirement: &70114893430600 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '2.6'
46
+ type: :development
47
+ prerelease: false
48
+ version_requirements: *70114893430600
49
+ - !ruby/object:Gem::Dependency
50
+ name: guard
51
+ requirement: &70114893428100 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ version: '0.5'
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: *70114893428100
60
+ - !ruby/object:Gem::Dependency
61
+ name: guard-rspec
62
+ requirement: &70114893425000 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ version: '0.4'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: *70114893425000
71
+ - !ruby/object:Gem::Dependency
72
+ name: growl
73
+ requirement: &70114893423020 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
78
+ version: '1.0'
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: *70114893423020
82
+ description: ''
83
+ email:
84
+ - victorcrodrigues@gmail.com
85
+ - vinicius.higa@locaweb.com.br
86
+ - thekina@gmail.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - .gitignore
92
+ - Gemfile
93
+ - Guardfile
94
+ - README.md
95
+ - Rakefile
96
+ - examples/all.rb
97
+ - examples/embeds_many/invisible.rb
98
+ - examples/embeds_many/simple.rb
99
+ - examples/embeds_many/with_array.rb
100
+ - examples/embeds_many/with_class_name.rb
101
+ - examples/embeds_many/with_fields.rb
102
+ - examples/embeds_many/with_if.rb
103
+ - examples/embeds_many/with_nil_value.rb
104
+ - examples/embeds_many/with_start_key.rb
105
+ - examples/embeds_one/flattened.rb
106
+ - examples/embeds_one/simple.rb
107
+ - examples/embeds_one/with_class_name.rb
108
+ - examples/embeds_one/with_if.rb
109
+ - examples/embeds_one/with_start_key.rb
110
+ - examples/has_many/simple.rb
111
+ - examples/helper.rb
112
+ - examples/initialize/embeds_many.rb
113
+ - examples/initialize/embeds_many_array.rb
114
+ - examples/initialize/embeds_one.rb
115
+ - examples/initialize/simple.rb
116
+ - examples/properties/array_serialization.rb
117
+ - examples/properties/collections.rb
118
+ - examples/properties/simple.rb
119
+ - examples/properties/with_field.rb
120
+ - examples/properties/with_field_path.rb
121
+ - examples/properties/with_id.rb
122
+ - examples/properties/with_if.rb
123
+ - examples/properties/with_key_converter.rb
124
+ - examples/properties/with_two_key_converters.rb
125
+ - examples/properties/with_values.rb
126
+ - examples/summarization/simple.rb
127
+ - examples/to_input/embeds_many.rb
128
+ - examples/to_input/embeds_many_without_key.rb
129
+ - examples/to_input/embeds_one.rb
130
+ - examples/to_input/embeds_one_without_key.rb
131
+ - examples/to_input/flattened.rb
132
+ - examples/to_input/serializables.rb
133
+ - examples/to_input/simple.rb
134
+ - examples/to_input/with_field.rb
135
+ - examples/to_input/with_field_path.rb
136
+ - examples/to_input/with_fields.rb
137
+ - examples/to_input/without_key.rb
138
+ - examples/to_input/without_nil.rb
139
+ - lib/rest_model.rb
140
+ - lib/rest_model/configuration.rb
141
+ - lib/rest_model/key.rb
142
+ - lib/rest_model/key/association.rb
143
+ - lib/rest_model/key/builder.rb
144
+ - lib/rest_model/key/embeddable.rb
145
+ - lib/rest_model/key/embeddable/builder.rb
146
+ - lib/rest_model/key/embeddable/response.rb
147
+ - lib/rest_model/key/embeddable/retriever.rb
148
+ - lib/rest_model/key/embeddable/sender.rb
149
+ - lib/rest_model/key/href.rb
150
+ - lib/rest_model/key/href/response.rb
151
+ - lib/rest_model/key/property.rb
152
+ - lib/rest_model/key/property/builder.rb
153
+ - lib/rest_model/key/property/response.rb
154
+ - lib/rest_model/key/property/retriever.rb
155
+ - lib/rest_model/key/property/sender.rb
156
+ - lib/rest_model/key/relation.rb
157
+ - lib/rest_model/key/relation/builder.rb
158
+ - lib/rest_model/key/relation/response.rb
159
+ - lib/rest_model/response.rb
160
+ - lib/rest_model/serialization/boolean.rb
161
+ - lib/rest_model/serialization/date.rb
162
+ - lib/rest_model/serialization/enumerable.rb
163
+ - lib/rest_model/serialization/float.rb
164
+ - lib/rest_model/serialization/integer.rb
165
+ - lib/rest_model/serialization/string.rb
166
+ - lib/rest_model/source/path.rb
167
+ - lib/rest_model/source/retriever.rb
168
+ - lib/rest_model/source/sender.rb
169
+ - lib/rest_model/version.rb
170
+ - rest_model.gemspec
171
+ - spec/.DS_Store
172
+ - spec/integration/embeds_many_spec.rb
173
+ - spec/integration/embeds_one_spec.rb
174
+ - spec/integration/has_many_spec.rb
175
+ - spec/integration/property_spec.rb
176
+ - spec/integration/summarization_spec.rb
177
+ - spec/spec_helper.rb
178
+ - spec/support/examples.rb
179
+ - spec/support/out.rb
180
+ - spec/support/shared_examples.rb
181
+ - spec/unit/configuration_spec.rb
182
+ - spec/unit/key/association_spec.rb
183
+ - spec/unit/key/embeddable/builder_spec.rb
184
+ - spec/unit/key/embeddable/response_spec.rb
185
+ - spec/unit/key/embeddable/retriever_spec.rb
186
+ - spec/unit/key/embeddable_spec.rb
187
+ - spec/unit/key/property/builder_spec.rb
188
+ - spec/unit/key/property/response_spec.rb
189
+ - spec/unit/key/property/retriever_spec.rb
190
+ - spec/unit/key/property_spec.rb
191
+ - spec/unit/key/relation/builder_spec.rb
192
+ - spec/unit/key/relation/response_spec.rb
193
+ - spec/unit/key/relation_spec.rb
194
+ - spec/unit/key_spec.rb
195
+ - spec/unit/response_spec.rb
196
+ - spec/unit/rest_model_spec.rb
197
+ - spec/unit/serialization/boolean_spec.rb
198
+ - spec/unit/serialization/date_spec.rb
199
+ - spec/unit/serialization/float_spec.rb
200
+ - spec/unit/serialization/integer_spec.rb
201
+ - spec/unit/serialization/string_spec.rb
202
+ - spec/unit/source/path_spec.rb
203
+ - spec/unit/source/retriever_spec.rb
204
+ homepage: http://github.com/rodrigues/rest_model
205
+ licenses: []
206
+ post_install_message:
207
+ rdoc_options: []
208
+ require_paths:
209
+ - lib
210
+ required_ruby_version: !ruby/object:Gem::Requirement
211
+ none: false
212
+ requirements:
213
+ - - ! '>='
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ required_rubygems_version: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ requirements: []
223
+ rubyforge_project:
224
+ rubygems_version: 1.8.6
225
+ signing_key:
226
+ specification_version: 3
227
+ summary: ''
228
+ test_files:
229
+ - spec/integration/embeds_many_spec.rb
230
+ - spec/integration/embeds_one_spec.rb
231
+ - spec/integration/has_many_spec.rb
232
+ - spec/integration/property_spec.rb
233
+ - spec/integration/summarization_spec.rb
234
+ - spec/spec_helper.rb
235
+ - spec/support/examples.rb
236
+ - spec/support/out.rb
237
+ - spec/support/shared_examples.rb
238
+ - spec/unit/configuration_spec.rb
239
+ - spec/unit/key/association_spec.rb
240
+ - spec/unit/key/embeddable/builder_spec.rb
241
+ - spec/unit/key/embeddable/response_spec.rb
242
+ - spec/unit/key/embeddable/retriever_spec.rb
243
+ - spec/unit/key/embeddable_spec.rb
244
+ - spec/unit/key/property/builder_spec.rb
245
+ - spec/unit/key/property/response_spec.rb
246
+ - spec/unit/key/property/retriever_spec.rb
247
+ - spec/unit/key/property_spec.rb
248
+ - spec/unit/key/relation/builder_spec.rb
249
+ - spec/unit/key/relation/response_spec.rb
250
+ - spec/unit/key/relation_spec.rb
251
+ - spec/unit/key_spec.rb
252
+ - spec/unit/response_spec.rb
253
+ - spec/unit/rest_model_spec.rb
254
+ - spec/unit/serialization/boolean_spec.rb
255
+ - spec/unit/serialization/date_spec.rb
256
+ - spec/unit/serialization/float_spec.rb
257
+ - spec/unit/serialization/integer_spec.rb
258
+ - spec/unit/serialization/string_spec.rb
259
+ - spec/unit/source/path_spec.rb
260
+ - spec/unit/source/retriever_spec.rb