lhs 14.6.5 → 15.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/README.md +68 -68
  4. data/lhs.gemspec +1 -1
  5. data/lib/lhs/concerns/record/endpoints.rb +1 -1
  6. data/lib/lhs/concerns/record/request.rb +1 -1
  7. data/lib/lhs/version.rb +1 -1
  8. data/spec/autoloading_spec.rb +2 -2
  9. data/spec/collection/collection_items_spec.rb +1 -1
  10. data/spec/collection/configurable_spec.rb +1 -1
  11. data/spec/collection/meta_data_spec.rb +4 -4
  12. data/spec/collection/without_object_items_spec.rb +1 -1
  13. data/spec/data/collection_spec.rb +1 -1
  14. data/spec/data/inspect_spec.rb +1 -1
  15. data/spec/data/item_spec.rb +2 -2
  16. data/spec/data/merge_spec.rb +2 -2
  17. data/spec/data/raw_spec.rb +3 -3
  18. data/spec/data/root_spec.rb +3 -3
  19. data/spec/data/select_spec.rb +1 -1
  20. data/spec/data/to_json_spec.rb +2 -2
  21. data/spec/dummy/app/models/user.rb +1 -1
  22. data/spec/endpoint/for_url_spec.rb +6 -6
  23. data/spec/item/becomes_spec.rb +2 -2
  24. data/spec/item/delegate_spec.rb +2 -2
  25. data/spec/item/destroy_spec.rb +3 -3
  26. data/spec/item/dig_spec.rb +1 -1
  27. data/spec/item/errors_spec.rb +2 -2
  28. data/spec/item/fetch_spec.rb +1 -1
  29. data/spec/item/getter_spec.rb +2 -2
  30. data/spec/item/internal_data_structure_spec.rb +2 -2
  31. data/spec/item/map_spec.rb +1 -1
  32. data/spec/item/partial_update_spec.rb +4 -4
  33. data/spec/item/save_spec.rb +2 -2
  34. data/spec/item/setter_spec.rb +2 -2
  35. data/spec/item/update_spec.rb +2 -2
  36. data/spec/item/validation_spec.rb +2 -2
  37. data/spec/pagination/pages_left_spec.rb +1 -1
  38. data/spec/proxy/create_sub_resource_spec.rb +2 -2
  39. data/spec/proxy/load_spec.rb +2 -2
  40. data/spec/proxy/record_identification_spec.rb +1 -1
  41. data/spec/record/build_spec.rb +2 -2
  42. data/spec/record/cast_nested_data_spec.rb +6 -6
  43. data/spec/record/create_spec.rb +2 -2
  44. data/spec/record/creation_failed_spec.rb +2 -2
  45. data/spec/record/definitions_spec.rb +2 -2
  46. data/spec/record/destroy_spec.rb +1 -1
  47. data/spec/record/endpoint_inheritance_spec.rb +3 -3
  48. data/spec/record/endpoint_misconfiguration_spec.rb +4 -4
  49. data/spec/record/endpoint_options_spec.rb +1 -1
  50. data/spec/record/endpoints_spec.rb +19 -19
  51. data/spec/record/find_by_spec.rb +4 -4
  52. data/spec/record/find_each_spec.rb +2 -2
  53. data/spec/record/find_in_batches_spec.rb +4 -4
  54. data/spec/record/find_in_parallel_spec.rb +1 -1
  55. data/spec/record/find_spec.rb +4 -4
  56. data/spec/record/first_spec.rb +2 -2
  57. data/spec/record/has_many_spec.rb +1 -1
  58. data/spec/record/ignore_errors_spec.rb +1 -1
  59. data/spec/record/includes_all_spec.rb +7 -7
  60. data/spec/record/includes_spec.rb +28 -28
  61. data/spec/record/includes_warning_spec.rb +1 -1
  62. data/spec/record/item_key_spec.rb +1 -1
  63. data/spec/record/loading_twice_spec.rb +2 -2
  64. data/spec/record/mapping_spec.rb +5 -5
  65. data/spec/record/model_name_spec.rb +1 -1
  66. data/spec/record/new_spec.rb +3 -3
  67. data/spec/record/options_spec.rb +2 -2
  68. data/spec/record/paginatable_collection_spec.rb +4 -4
  69. data/spec/record/pagination_chain_spec.rb +3 -3
  70. data/spec/record/pagination_spec.rb +1 -1
  71. data/spec/record/persisted_spec.rb +1 -1
  72. data/spec/record/references_spec.rb +1 -1
  73. data/spec/record/reload_by_id_spec.rb +2 -2
  74. data/spec/record/reload_spec.rb +2 -2
  75. data/spec/record/request_spec.rb +6 -6
  76. data/spec/record/save_spec.rb +1 -1
  77. data/spec/record/scope_chains_spec.rb +1 -1
  78. data/spec/record/to_json_spec.rb +1 -1
  79. data/spec/record/where_chains_spec.rb +1 -1
  80. data/spec/record/where_spec.rb +2 -2
  81. data/spec/record/where_values_hash_spec.rb +1 -1
  82. data/spec/request_cycle_cache/main_spec.rb +1 -1
  83. data/spec/views/form_for_spec.rb +1 -1
  84. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d314851756abb4c8542c39011a7f433d55d542db
4
- data.tar.gz: 9ca7e69b7720fa51b046a50087959c4fc37b895f
3
+ metadata.gz: 0bd4227239bcdbb798aa8a247eafdde0d26281b1
4
+ data.tar.gz: 0dcbf3830c7adf536d74b815ba3ceb4ce9c3e0a9
5
5
  SHA512:
6
- metadata.gz: 012881ad83d2e83ba0d20d8ba136b50a6ed97ff8d436a3d908bbd2a2741ab82471dea24f4bd6137ed9f0d6835e9e41ee11bf7a316f8a915561a2549450fc6f2b
7
- data.tar.gz: 71c2fc67eee61bc360c2a16183aa734d6cbac1acd8b153bffd13f5b088760ee0cb27563066c84408eab8a5c93aa72743af204c309f8debcde2606270147d0de3
6
+ metadata.gz: 55eb024313e5824288d2ec1741c6e3ec926200449e515d888be415552b9a39a86523d3e1b5e3edadd78ac48c9d881143e14e6f332ae26ee5957497c839b6a6a1
7
+ data.tar.gz: 4e975157294c34983a4c2e438f5f0fde7b0eade11768c894f8af72cd5f7dc98365c1429b2ce0b512986f3ced4e3da821fc14e3deb3190cd533800cdfa94e6cab
@@ -1 +1 @@
1
- ruby-2.3.0
1
+ ruby-2.4.3
data/README.md CHANGED
@@ -20,13 +20,13 @@ end
20
20
 
21
21
  ## Very Short Introduction
22
22
 
23
- Access data that is provided by an http json service with ease using a LHS::Record.
23
+ Access data that is provided by an http JSON service with ease using a LHS::Record.
24
24
 
25
25
  ```ruby
26
26
  class Record < LHS::Record
27
27
 
28
- endpoint ':service/v2/records'
29
- endpoint ':service/v2/association/:association_id/records'
28
+ endpoint '{+service}/v2/records'
29
+ endpoint '{+service}/v2/association/{association_id}/records'
30
30
 
31
31
  end
32
32
 
@@ -36,7 +36,7 @@ record.review # "Lunch was great"
36
36
 
37
37
  ## Where to store LHS::Records
38
38
 
39
- Please store all defined LHS::Records in `app/models` as they are not autoloaded by rails otherwise.
39
+ Please store all defined LHS::Records in `app/models` as they are not auto loaded by rails otherwise.
40
40
 
41
41
  ## Endpoints
42
42
 
@@ -45,10 +45,10 @@ You setup a LHS::Record by configuring one or multiple endpoints. You can also a
45
45
  ```ruby
46
46
  class Record < LHS::Record
47
47
 
48
- endpoint ':service/v2/association/:association_id/records'
49
- endpoint ':service/v2/association/:association_id/records/:id'
50
- endpoint ':service/v2/records', auth: { basic: 'PASSWORD' }
51
- endpoint ':service/v2/records/:id', auth: { basic: 'PASSWORD' }
48
+ endpoint '{+service}/v2/association/{association_id}/records'
49
+ endpoint '{+service}/v2/association/{association_id}/records/{id}'
50
+ endpoint '{+service}/v2/records', auth: { basic: 'PASSWORD' }
51
+ endpoint '{+service}/v2/records/{id}', auth: { basic: 'PASSWORD' }
52
52
 
53
53
  end
54
54
  ```
@@ -61,8 +61,8 @@ If you try to setup a LHS::Record with clashing endpoints it will immediately ra
61
61
  ```ruby
62
62
  class Record < LHS::Record
63
63
 
64
- endpoint ':service/v2/records'
65
- endpoint ':service/v2/something_else'
64
+ endpoint '{+service}/v2/records'
65
+ endpoint '{+service}/v2/something_else'
66
66
 
67
67
  end
68
68
  # raises: Clashing endpoints.
@@ -76,13 +76,13 @@ You can query a service for records by using `where`.
76
76
  Record.where(color: 'blue')
77
77
  ```
78
78
 
79
- This uses the `:service/v2/records` endpoint, cause `:association_id` was not provided. In addition it would add `?color=blue` to the get parameters.
79
+ This uses the `{+service}/v2/records` endpoint, cause `{association_id}` was not provided. In addition it would add `?color=blue` to the get parameters.
80
80
 
81
81
  ```ruby
82
82
  Record.where(association_id: 'fq-a81ngsl1d')
83
83
  ```
84
84
 
85
- Uses the `:service/v2/association/:association_id/records` endpoint.
85
+ Uses the `{+service}/v2/association/{association_id}/records` endpoint.
86
86
 
87
87
  ### Expand plain collection of links
88
88
 
@@ -118,7 +118,7 @@ That allows you to chain multiple where-queries:
118
118
  ```ruby
119
119
  class Record < LHS::Record
120
120
  endpoint 'records/'
121
- endpoint 'records/:id'
121
+ endpoint 'records/{id}'
122
122
  end
123
123
 
124
124
  records = Record.where(color: 'blue')
@@ -151,12 +151,12 @@ expect(
151
151
 
152
152
  ## Scopes: Reuse where statements
153
153
 
154
- In order to make common where statements reusable you can organise them in scopes:
154
+ In order to make common where statements reusable you can organize them in scopes:
155
155
 
156
156
  ```ruby
157
157
  class Record < LHS::Record
158
158
  endpoint 'records/'
159
- endpoint 'records/:id'
159
+ endpoint 'records/{id}'
160
160
  scope :blue, -> { where(color: 'blue') }
161
161
  scope :available, ->(state) { where(available: state) }
162
162
  end
@@ -171,7 +171,7 @@ One benefit of chains is lazy evaluation. This means they get resolved when data
171
171
 
172
172
  To simplify error handling with chains, you can also chain error handlers to be resolved, as part of the chain.
173
173
 
174
- In case no matchin error handler is found the error gets re-raised.
174
+ In case no matching error handler is found the error gets re-raised.
175
175
 
176
176
  ```ruby
177
177
  record = Record.where(color: 'blue')
@@ -193,7 +193,7 @@ record # nil
193
193
 
194
194
  ## Resolve chains
195
195
 
196
- LHS Chains can be resolved with `fetch`, similiar to ActiveRecord:
196
+ LHS Chains can be resolved with `fetch`, similar to ActiveRecord:
197
197
 
198
198
  ```ruby
199
199
  records = Record.where(color: 'blue').fetch
@@ -201,7 +201,7 @@ records = Record.where(color: 'blue').fetch
201
201
 
202
202
  ## Find single records
203
203
 
204
- `find` finds a unique record by unique identifier (usualy id or href).
204
+ `find` finds a unique record by unique identifier (usually id or href).
205
205
 
206
206
  ```ruby
207
207
  Record.find(123)
@@ -268,7 +268,7 @@ After fetching [single](#find-single-records) or [multiple](#find-multiple-recor
268
268
 
269
269
  ## Relations
270
270
 
271
- Even though, nested data is automatically casted when accessed, see: [Nested records](#nested-records), sometimes api's don't provide dedicated endpoints to retrive these records.
271
+ Even though, nested data is automatically casted when accessed, see: [Nested records](#nested-records), sometimes api's don't provide dedicated endpoints to retrieve these records.
272
272
 
273
273
  As those records also don't have an href, nested records can not be casted automatically, when accessed.
274
274
 
@@ -277,15 +277,15 @@ Those kind of relations, you can still configure manually:
277
277
  ```ruby
278
278
 
279
279
  class Location < LHS::Record
280
-
281
- endpoint 'http://uberall/locations/:id'
280
+
281
+ endpoint 'http://uberall/locations/{id}'
282
282
 
283
283
  has_many :listings
284
284
 
285
285
  end
286
286
 
287
287
  class Listing < LHS::Record
288
-
288
+
289
289
  def supported?
290
290
  type == 'SUPPORTED'
291
291
  end
@@ -329,7 +329,7 @@ By default, LHS does not perform the same http request during one request cycle
329
329
 
330
330
  It uses the [LHC Caching Interceptor](https://github.com/local-ch/lhc/blob/master/docs/interceptors/caching.md) as caching mechanism base and sets a unique request id for every request cycle with Railties to ensure data is just cached within one request cycle and not shared with other requests.
331
331
 
332
- Only GET requests are considered for caching by using LHC Caching Interceptor's `cache_methods` option internaly and considers request headers when caching requests, so requests with different headers are not served from cache.
332
+ Only GET requests are considered for caching by using LHC Caching Interceptor's `cache_methods` option internally and considers request headers when caching requests, so requests with different headers are not served from cache.
333
333
 
334
334
  The LHS Request Cycle Cache is opt-out, so it's enabled by default and will require you to enable the [LHC Caching Interceptor](https://github.com/local-ch/lhc/blob/master/docs/interceptors/caching.md) in your project.
335
335
 
@@ -374,7 +374,7 @@ In case an API does not provide pagination information (limit, offset and total)
374
374
 
375
375
  ```ruby
376
376
  Record.find_each(start: 50, batch_size: 20, params: { has_reviews: true }) do |record|
377
- # Iterates over each record. Starts with record nr. 50 and fetches 20 records each batch.
377
+ # Iterates over each record. Starts with record no. 50 and fetches 20 records each batch.
378
378
  record
379
379
  break if record.some_attribute == some_value
380
380
  end
@@ -383,7 +383,7 @@ end
383
383
  `find_in_batches` is used by `find_each` and processes batches.
384
384
  ```ruby
385
385
  Record.find_in_batches(start: 50, batch_size: 20, params: { has_reviews: true }) do |records|
386
- # Iterates over multiple records (batch size is 20). Starts with record nr. 50 and fetches 20 records each batch.
386
+ # Iterates over multiple records (batch size is 20). Starts with record no. 50 and fetches 20 records each batch.
387
387
  records
388
388
  break if records.first.name == some_value
389
389
  end
@@ -405,11 +405,11 @@ See [Validation](#Validation) for handling validation errors when creating recor
405
405
 
406
406
  ```ruby
407
407
  class Review < LHS::Record
408
- endpoint ':service/reviews'
408
+ endpoint '{+service}/reviews'
409
409
  end
410
410
 
411
411
  class Comment < LHS::Record
412
- endpoint ':service/reviews/:review_id/comments'
412
+ endpoint '{+service}/reviews/{review_id/}comments'
413
413
  end
414
414
  ```
415
415
 
@@ -417,20 +417,20 @@ See [Validation](#Validation) for handling validation errors when creating recor
417
417
  ```ruby
418
418
  review = Review.find(1)
419
419
  # Review#1
420
- # :href => ':service/reviews/1
420
+ # :href => '{+service}/reviews/1
421
421
  # :text => 'Simply awesome'
422
- # :comment => { :href => ':service/reviews/1/comments }
422
+ # :comment => { :href => '{+service}/reviews/1/comments }
423
423
 
424
424
  review.comment.create(text: 'Thank you!')
425
425
  # Comment#1
426
- # :href => ':service/reviews/1/comments
426
+ # :href => '{+service}/reviews/1/comments
427
427
  # :text => 'Thank you!'
428
428
 
429
429
  review
430
430
  # Review#1
431
- # :href => ':service/reviews/1
431
+ # :href => '{+service}/reviews/1
432
432
  # :text => 'Simply awesome'
433
- # :comment => { :href => ':service/reviews/1/comments, :text => 'Thank you!' }
433
+ # :comment => { :href => '{+service}/reviews/1/comments, :text => 'Thank you!' }
434
434
  ```
435
435
 
436
436
  If the item already exists `ArgumentError` is raised.
@@ -439,40 +439,40 @@ If the item already exists `ArgumentError` is raised.
439
439
  ```ruby
440
440
  review = Review.includes(:comments).find(1)
441
441
  # Review#1
442
- # :href => ':service/reviews/1'
442
+ # :href => '{+service}/reviews/1'
443
443
  # :text => 'Simply awesome'
444
- # :comments => { :href => ':service/reviews/1/comments, :items => [] }
444
+ # :comments => { :href => '{+service}/reviews/1/comments, :items => [] }
445
445
 
446
446
  review.comments.create(text: 'Thank you!')
447
447
  # Comment#1
448
- # :href => ':service/reviews/1/comments/1'
448
+ # :href => '{+service}/reviews/1/comments/1'
449
449
  # :text => 'Thank you!'
450
450
 
451
451
  review
452
452
  # Review#1
453
- # :href => ':service/reviews/1'
453
+ # :href => '{+service}/reviews/1'
454
454
  # :text => 'Simply awesome'
455
- # :comments => { :href => ':service/reviews/1/comments, :items => [{ :href => ':service/reviews/1/comments/1', :text => 'Thank you!' }] }
455
+ # :comments => { :href => '{+service}/reviews/1/comments, :items => [{ :href => '{+service}/reviews/1/comments/1', :text => 'Thank you!' }] }
456
456
  ```
457
457
 
458
458
  ### Not expanded collection
459
459
  ```ruby
460
460
  review = Review.find(1)
461
461
  # Review#1
462
- # :href => ':service/reviews/1'
462
+ # :href => '{+service}/reviews/1'
463
463
  # :text => 'Simply awesome'
464
- # :comments => { :href => ':service/reviews/1/comments' }
464
+ # :comments => { :href => '{+service}/reviews/1/comments' }
465
465
 
466
466
  review.comments.create(text: 'Thank you!')
467
467
  # Comment#1
468
- # :href => ':service/reviews/1/comments/1'
468
+ # :href => '{+service}/reviews/1/comments/1'
469
469
  # :text => 'Thank you!'
470
470
 
471
471
  review
472
472
  # Review#1
473
- # :href => ':service/reviews/1
473
+ # :href => '{+service}/reviews/1
474
474
  # :text => 'Simply awesome'
475
- # :comments => { :href => ':service/reviews/1/comments', :items => [{ :href => ':service/reviews/1/comments/1', :text => 'Thank you!' }] }
475
+ # :comments => { :href => '{+service}/reviews/1/comments', :items => [{ :href => '{+service}/reviews/1/comments/1', :text => 'Thank you!' }] }
476
476
  ```
477
477
 
478
478
  ## Build new records
@@ -632,15 +632,15 @@ The [Auth Inteceptor](https://github.com/local-ch/lhc-core-interceptors#auth-int
632
632
  ```ruby
633
633
  class Favorite < LHS::Record
634
634
 
635
- endpoint ':service/:user_id/favorites', auth: { basic: { username: 'steve', password: 'can' } }
636
- endpoint ':service/:user_id/favorites/:id', auth: { basic: { username: 'steve', password: 'can' } }
635
+ endpoint '{+service}/{user_id}/favorites', auth: { basic: { username: 'steve', password: 'can' } }
636
+ endpoint '{+service}/{user_id}/favorites/:id', auth: { basic: { username: 'steve', password: 'can' } }
637
637
 
638
638
  end
639
639
 
640
640
  class Place < LHS::Record
641
641
 
642
- endpoint ':service/v2/places', auth: { basic: { username: 'steve', password: 'can' } }
643
- endpoint ':service/v2/places/:id', auth: { basic: { username: 'steve', password: 'can' } }
642
+ endpoint '{+service}/v2/places', auth: { basic: { username: 'steve', password: 'can' } }
643
+ endpoint '{+service}/v2/places/{id}', auth: { basic: { username: 'steve', password: 'can' } }
644
644
 
645
645
  end
646
646
 
@@ -660,7 +660,7 @@ Provide options to the requests made to include referenced resources:
660
660
 
661
661
  ## Map data
662
662
 
663
- To influence how data is accessed/provied, you can use mappings to either map deep nested data or to manipulate data when its accessed. Simply create methods inside the LHS::Record. They can access underlying data:
663
+ To influence how data is accessed/provided, you can use mappings to either map deep nested data or to manipulate data when its accessed. Simply create methods inside the LHS::Record. They can access underlying data:
664
664
 
665
665
  ```ruby
666
666
  class LocalEntry < LHS::Record
@@ -675,11 +675,11 @@ end
675
675
 
676
676
  ## Nested records
677
677
 
678
- Nested records (in nested data) are automaticaly casted when the href matches any defined endpoint of any LHS::Record.
678
+ Nested records (in nested data) are automatically casted when the href matches any defined endpoint of any LHS::Record.
679
679
 
680
680
  ```ruby
681
681
  class Place < LHS::Record
682
- endpoint ':service/v2/places'
682
+ endpoint '{+service}/v2/places'
683
683
 
684
684
  def name
685
685
  addresses.first.business.identities.first.name
@@ -687,7 +687,7 @@ class Place < LHS::Record
687
687
  end
688
688
 
689
689
  class Favorite < LHS::Record
690
- endpoint ':service/v2/favorites'
690
+ endpoint '{+service}/v2/favorites'
691
691
  end
692
692
 
693
693
  favorite = Favorite.includes(:place).find(1)
@@ -753,11 +753,11 @@ _NOTE: RPC-style actions, that are discouraged in REST anyway, are utilizable wi
753
753
  ```ruby
754
754
  class Location < LHS::Record
755
755
  endpoint 'http://sync/locations'
756
- endpoint 'http://sync/locations/:id'
756
+ endpoint 'http://sync/locations/{id}'
757
757
  end
758
758
 
759
759
  class Synchronization < LHS::Record
760
- endpoint 'http://sync/locations/:id/sync'
760
+ endpoint 'http://sync/locations/{id}/sync'
761
761
  end
762
762
 
763
763
  location = Location.find(1)
@@ -790,14 +790,14 @@ or with parameters:
790
790
 
791
791
  In order to validate LHS::Records before persisting them, you can use the `valid?` (`validate` alias) method.
792
792
 
793
- The specific endpoint has to support validations without persistance. An endpoint has to be enabled (opt-in) for validations in the service configuration.
793
+ The specific endpoint has to support validations without persistence. An endpoint has to be enabled (opt-in) for validations in the service configuration.
794
794
 
795
795
  ```ruby
796
796
  class User < LHS::Record
797
- endpoint ':service/v2/users', validates: { params: { persist: false } }
797
+ endpoint '{+service}/v2/users', validates: { params: { persist: false } }
798
798
  end
799
799
 
800
- user = User.build(email: 'im not an email address')
800
+ user = User.build(email: 'i\'m not an email address')
801
801
  unless user.valid?
802
802
  fail(user.errors[:email])
803
803
  end
@@ -813,10 +813,10 @@ user.errors.message # email must be set when user is created."
813
813
  The parameters passed to the `validates` endpoint option are used to perform the validation:
814
814
 
815
815
  ```ruby
816
- endpoint ':service/v2/users', validates: { params: { persist: false } } # will add ?persist=false to the request
817
- endpoint ':service/v2/users', validates: { params: { publish: false } } # will add ?publish=false to the request
818
- endpoint ':service/v2/users', validates: { params: { validates: true } } # will add ?validates=true to the request
819
- endpoint ':service/v2/users', validates: { path: 'validate' } # will perform a validation via :service/v2/users/validate
816
+ endpoint '{+service}/v2/users', validates: { params: { persist: false } } # will add ?persist=false to the request
817
+ endpoint '{+service}/v2/users', validates: { params: { publish: false } } # will add ?publish=false to the request
818
+ endpoint '{+service}/v2/users', validates: { params: { validates: true } } # will add ?validates=true to the request
819
+ endpoint '{+service}/v2/users', validates: { path: 'validate' } # will perform a validation via :service/v2/users/validate
820
820
  ```
821
821
 
822
822
  ### HTTP Status Codes for validation errors
@@ -953,7 +953,7 @@ Warnings behave like [Validation Errors](#Validation) and implements the same in
953
953
 
954
954
  LHS supports paginated APIs and it also supports various pagination strategies and by providing configuration possibilities.
955
955
 
956
- LHS diffentiates between the *pagination strategy* (how items/pages are navigated) itself and *pagination keys* (how stuff is named).
956
+ LHS differentiates between the *pagination strategy* (how items/pages are navigated) itself and *pagination keys* (how stuff is named).
957
957
 
958
958
  *Example 1 "offset"-strategy (default configuration)*
959
959
  ```ruby
@@ -1019,7 +1019,7 @@ class Search < LHS::Record
1019
1019
  end
1020
1020
  ```
1021
1021
 
1022
- `item_key` key used to unwrap the actuall object from within the response body.
1022
+ `item_key` key used to unwrap the actual object from within the response body.
1023
1023
 
1024
1024
  `items_key` key used to determine items of the current page (e.g. `docs`, `items`, etc.).
1025
1025
 
@@ -1027,7 +1027,7 @@ end
1027
1027
 
1028
1028
  `limit_key` key used to work with page limits (e.g. `size`, `limit`, etc.)
1029
1029
 
1030
- In case the `limit_key` parameter differs for where it's located in the body and how it's provided as get parameter, when retreiving pages, provide a hash with `body` and `paramter` key, to keep those two use cases separated:
1030
+ In case the `limit_key` parameter differs for where it's located in the body and how it's provided as get parameter, when retreiving pages, provide a hash with `body` and `parameter` key, to keep those two use cases separated:
1031
1031
 
1032
1032
  ```ruby
1033
1033
  configuration limit_key: { body: [:response, :max], parameter: :max }
@@ -1035,7 +1035,7 @@ In case the `limit_key` parameter differs for where it's located in the body and
1035
1035
 
1036
1036
  `pagination_key` key used to paginate multiple pages (e.g. `offset`, `page`, `startAt` etc.).
1037
1037
 
1038
- In case the `pagination_key` parameter differs for where it's located in the body and how it's provided as get parameter, when retreiving pages, provide a hash with `body` and `paramter` key, to keep those two use cases separated:
1038
+ In case the `pagination_key` parameter differs for where it's located in the body and how it's provided as get parameter, when retreiving pages, provide a hash with `body` and `parameter` key, to keep those two use cases separated:
1039
1039
 
1040
1040
  ```ruby
1041
1041
  configuration pagination_key: { body: [:response, :page], parameter: :page }
@@ -1125,7 +1125,7 @@ The applied pagination strategy depends on the actual configured pagination, so
1125
1125
 
1126
1126
  ```ruby
1127
1127
  class Record < LHS::Record
1128
- endpoint ':service/records'
1128
+ endpoint '{+service}/records'
1129
1129
  configuration pagination_strategy: 'page'
1130
1130
  end
1131
1131
  Record.page(3).per(20).where(color: 'blue')
@@ -1134,7 +1134,7 @@ The applied pagination strategy depends on the actual configured pagination, so
1134
1134
 
1135
1135
  ```ruby
1136
1136
  class Record < LHS::Record
1137
- endpoint ':service/records'
1137
+ endpoint '{+service}/records'
1138
1138
  configuration pagination_strategy: 'start'
1139
1139
  end
1140
1140
  Record.page(3).per(20).where(color: 'blue')
@@ -1172,7 +1172,7 @@ When endpoints provide indicators for current page position with links (like `ne
1172
1172
 
1173
1173
  How to configure endpoints for automatic collection detection?
1174
1174
 
1175
- LHS detects autmatically if the responded data is a single business object or a set of business objects (collection).
1175
+ LHS detects automatically if the responded data is a single business object or a set of business objects (collection).
1176
1176
 
1177
1177
  Conventionally, when the responds contains an `items` key `{ items: [] }` it's treated as a collection, but also if the responds contains a plain raw array: `[{ href: '' }]` it's also treated as a collection.
1178
1178
 
@@ -1196,7 +1196,7 @@ Rails `form_for` view-helper can be used in combination with instances of LHS::R
1196
1196
 
1197
1197
  ## Count vs. Length
1198
1198
 
1199
- The behaviour of `count` and `length` is based on ActiveRecord's behaviour.
1199
+ The behavior of `count` and `length` is based on ActiveRecord's behavior.
1200
1200
 
1201
1201
  `count` Determine the number of elements by taking the number of total elements that is provided by the endpoint/api.
1202
1202
 
@@ -1208,7 +1208,7 @@ You can inherit from previously defined records and also inherit endpoints that
1208
1208
 
1209
1209
  ```
1210
1210
  class Base < LHS::Record
1211
- endpoint 'records/:id'
1211
+ endpoint 'records/{id}'
1212
1212
  end
1213
1213
 
1214
1214
  class Example < Base
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.requirements << 'Ruby >= 2.3.0'
21
21
  s.required_ruby_version = '>= 2.3.0'
22
22
 
23
- s.add_dependency 'lhc', '>= 6.4.0'
23
+ s.add_dependency 'lhc', '>= 7.0.0'
24
24
  s.add_dependency 'activesupport', '> 4.2'
25
25
  s.add_dependency 'activemodel'
26
26