lookout-mongo_mapper 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +33 -0
  3. data/UPGRADES +26 -0
  4. data/bin/mmconsole +59 -0
  5. data/examples/attr_accessible.rb +22 -0
  6. data/examples/attr_protected.rb +22 -0
  7. data/examples/cache_key.rb +24 -0
  8. data/examples/custom_types.rb +24 -0
  9. data/examples/identity_map.rb +33 -0
  10. data/examples/identity_map/automatic.rb +2 -0
  11. data/examples/keys.rb +40 -0
  12. data/examples/modifiers/set.rb +25 -0
  13. data/examples/plugins.rb +38 -0
  14. data/examples/querying.rb +35 -0
  15. data/examples/safe.rb +43 -0
  16. data/examples/scopes.rb +52 -0
  17. data/examples/validating/embedded_docs.rb +29 -0
  18. data/lib/mongo_mapper.rb +94 -0
  19. data/lib/mongo_mapper/connection.rb +96 -0
  20. data/lib/mongo_mapper/document.rb +42 -0
  21. data/lib/mongo_mapper/embedded_document.rb +32 -0
  22. data/lib/mongo_mapper/exceptions.rb +30 -0
  23. data/lib/mongo_mapper/extensions/array.rb +19 -0
  24. data/lib/mongo_mapper/extensions/binary.rb +22 -0
  25. data/lib/mongo_mapper/extensions/boolean.rb +44 -0
  26. data/lib/mongo_mapper/extensions/date.rb +25 -0
  27. data/lib/mongo_mapper/extensions/float.rb +14 -0
  28. data/lib/mongo_mapper/extensions/hash.rb +14 -0
  29. data/lib/mongo_mapper/extensions/integer.rb +19 -0
  30. data/lib/mongo_mapper/extensions/kernel.rb +9 -0
  31. data/lib/mongo_mapper/extensions/nil_class.rb +18 -0
  32. data/lib/mongo_mapper/extensions/object.rb +26 -0
  33. data/lib/mongo_mapper/extensions/object_id.rb +32 -0
  34. data/lib/mongo_mapper/extensions/set.rb +20 -0
  35. data/lib/mongo_mapper/extensions/string.rb +18 -0
  36. data/lib/mongo_mapper/extensions/time.rb +28 -0
  37. data/lib/mongo_mapper/locale/en.yml +5 -0
  38. data/lib/mongo_mapper/middleware/identity_map.rb +16 -0
  39. data/lib/mongo_mapper/plugins.rb +22 -0
  40. data/lib/mongo_mapper/plugins/accessible.rb +52 -0
  41. data/lib/mongo_mapper/plugins/active_model.rb +18 -0
  42. data/lib/mongo_mapper/plugins/associations.rb +90 -0
  43. data/lib/mongo_mapper/plugins/associations/base.rb +92 -0
  44. data/lib/mongo_mapper/plugins/associations/belongs_to_association.rb +54 -0
  45. data/lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb +34 -0
  46. data/lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb +52 -0
  47. data/lib/mongo_mapper/plugins/associations/collection.rb +27 -0
  48. data/lib/mongo_mapper/plugins/associations/embedded_collection.rb +44 -0
  49. data/lib/mongo_mapper/plugins/associations/in_array_proxy.rb +133 -0
  50. data/lib/mongo_mapper/plugins/associations/many_association.rb +63 -0
  51. data/lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb +28 -0
  52. data/lib/mongo_mapper/plugins/associations/many_documents_proxy.rb +118 -0
  53. data/lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb +32 -0
  54. data/lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb +24 -0
  55. data/lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb +14 -0
  56. data/lib/mongo_mapper/plugins/associations/one_as_proxy.rb +22 -0
  57. data/lib/mongo_mapper/plugins/associations/one_association.rb +48 -0
  58. data/lib/mongo_mapper/plugins/associations/one_embedded_polymorphic_proxy.rb +30 -0
  59. data/lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb +44 -0
  60. data/lib/mongo_mapper/plugins/associations/one_proxy.rb +95 -0
  61. data/lib/mongo_mapper/plugins/associations/proxy.rb +134 -0
  62. data/lib/mongo_mapper/plugins/associations/single_association.rb +46 -0
  63. data/lib/mongo_mapper/plugins/caching.rb +21 -0
  64. data/lib/mongo_mapper/plugins/callbacks.rb +29 -0
  65. data/lib/mongo_mapper/plugins/clone.rb +22 -0
  66. data/lib/mongo_mapper/plugins/dirty.rb +60 -0
  67. data/lib/mongo_mapper/plugins/document.rb +41 -0
  68. data/lib/mongo_mapper/plugins/dynamic_querying.rb +45 -0
  69. data/lib/mongo_mapper/plugins/dynamic_querying/dynamic_finder.rb +44 -0
  70. data/lib/mongo_mapper/plugins/embedded_callbacks.rb +56 -0
  71. data/lib/mongo_mapper/plugins/embedded_document.rb +53 -0
  72. data/lib/mongo_mapper/plugins/equality.rb +23 -0
  73. data/lib/mongo_mapper/plugins/identity_map.rb +128 -0
  74. data/lib/mongo_mapper/plugins/indexes.rb +13 -0
  75. data/lib/mongo_mapper/plugins/inspect.rb +16 -0
  76. data/lib/mongo_mapper/plugins/keys.rb +313 -0
  77. data/lib/mongo_mapper/plugins/keys/key.rb +61 -0
  78. data/lib/mongo_mapper/plugins/logger.rb +18 -0
  79. data/lib/mongo_mapper/plugins/modifiers.rb +134 -0
  80. data/lib/mongo_mapper/plugins/pagination.rb +16 -0
  81. data/lib/mongo_mapper/plugins/persistence.rb +69 -0
  82. data/lib/mongo_mapper/plugins/protected.rb +45 -0
  83. data/lib/mongo_mapper/plugins/querying.rb +165 -0
  84. data/lib/mongo_mapper/plugins/querying/decorator.rb +36 -0
  85. data/lib/mongo_mapper/plugins/rails.rb +58 -0
  86. data/lib/mongo_mapper/plugins/rails/active_record_association_adapter.rb +33 -0
  87. data/lib/mongo_mapper/plugins/safe.rb +28 -0
  88. data/lib/mongo_mapper/plugins/sci.rb +36 -0
  89. data/lib/mongo_mapper/plugins/scopes.rb +27 -0
  90. data/lib/mongo_mapper/plugins/serialization.rb +109 -0
  91. data/lib/mongo_mapper/plugins/timestamps.rb +22 -0
  92. data/lib/mongo_mapper/plugins/touch.rb +18 -0
  93. data/lib/mongo_mapper/plugins/userstamps.rb +18 -0
  94. data/lib/mongo_mapper/plugins/validations.rb +86 -0
  95. data/lib/mongo_mapper/railtie.rb +48 -0
  96. data/lib/mongo_mapper/railtie/database.rake +65 -0
  97. data/lib/mongo_mapper/translation.rb +10 -0
  98. data/lib/mongo_mapper/version.rb +4 -0
  99. data/lib/rails/generators/mongo_mapper/config/config_generator.rb +24 -0
  100. data/lib/rails/generators/mongo_mapper/config/templates/mongo.yml +18 -0
  101. data/lib/rails/generators/mongo_mapper/model/model_generator.rb +23 -0
  102. data/lib/rails/generators/mongo_mapper/model/templates/model.rb +13 -0
  103. data/test/_NOTE_ON_TESTING +1 -0
  104. data/test/functional/associations/test_belongs_to_polymorphic_proxy.rb +64 -0
  105. data/test/functional/associations/test_belongs_to_proxy.rb +238 -0
  106. data/test/functional/associations/test_in_array_proxy.rb +349 -0
  107. data/test/functional/associations/test_many_documents_as_proxy.rb +231 -0
  108. data/test/functional/associations/test_many_documents_proxy.rb +866 -0
  109. data/test/functional/associations/test_many_embedded_polymorphic_proxy.rb +239 -0
  110. data/test/functional/associations/test_many_embedded_proxy.rb +289 -0
  111. data/test/functional/associations/test_many_polymorphic_proxy.rb +303 -0
  112. data/test/functional/associations/test_one_as_proxy.rb +491 -0
  113. data/test/functional/associations/test_one_embedded_polymorphic_proxy.rb +208 -0
  114. data/test/functional/associations/test_one_embedded_proxy.rb +100 -0
  115. data/test/functional/associations/test_one_proxy.rb +383 -0
  116. data/test/functional/test_accessible.rb +198 -0
  117. data/test/functional/test_associations.rb +46 -0
  118. data/test/functional/test_binary.rb +27 -0
  119. data/test/functional/test_caching.rb +77 -0
  120. data/test/functional/test_callbacks.rb +232 -0
  121. data/test/functional/test_dirty.rb +301 -0
  122. data/test/functional/test_document.rb +282 -0
  123. data/test/functional/test_dynamic_querying.rb +75 -0
  124. data/test/functional/test_embedded_document.rb +288 -0
  125. data/test/functional/test_equality.rb +20 -0
  126. data/test/functional/test_identity_map.rb +513 -0
  127. data/test/functional/test_indexes.rb +50 -0
  128. data/test/functional/test_logger.rb +20 -0
  129. data/test/functional/test_modifiers.rb +537 -0
  130. data/test/functional/test_pagination.rb +91 -0
  131. data/test/functional/test_protected.rb +201 -0
  132. data/test/functional/test_querying.rb +935 -0
  133. data/test/functional/test_safe.rb +76 -0
  134. data/test/functional/test_sci.rb +240 -0
  135. data/test/functional/test_scopes.rb +171 -0
  136. data/test/functional/test_timestamps.rb +62 -0
  137. data/test/functional/test_touch.rb +125 -0
  138. data/test/functional/test_userstamps.rb +44 -0
  139. data/test/functional/test_validations.rb +414 -0
  140. data/test/models.rb +261 -0
  141. data/test/support/railtie.rb +4 -0
  142. data/test/support/railtie/autoloaded.rb +2 -0
  143. data/test/support/railtie/not_autoloaded.rb +3 -0
  144. data/test/support/railtie/parent.rb +3 -0
  145. data/test/test_active_model_lint.rb +18 -0
  146. data/test/test_helper.rb +93 -0
  147. data/test/unit/associations/test_base.rb +146 -0
  148. data/test/unit/associations/test_belongs_to_association.rb +29 -0
  149. data/test/unit/associations/test_many_association.rb +63 -0
  150. data/test/unit/associations/test_one_association.rb +47 -0
  151. data/test/unit/associations/test_proxy.rb +100 -0
  152. data/test/unit/serializers/test_json_serializer.rb +216 -0
  153. data/test/unit/serializers/test_xml_serializer.rb +196 -0
  154. data/test/unit/test_clone.rb +69 -0
  155. data/test/unit/test_document.rb +249 -0
  156. data/test/unit/test_dynamic_finder.rb +125 -0
  157. data/test/unit/test_embedded_document.rb +682 -0
  158. data/test/unit/test_equality.rb +38 -0
  159. data/test/unit/test_exceptions.rb +12 -0
  160. data/test/unit/test_extensions.rb +380 -0
  161. data/test/unit/test_identity_map_middleware.rb +34 -0
  162. data/test/unit/test_inspect.rb +47 -0
  163. data/test/unit/test_key.rb +205 -0
  164. data/test/unit/test_keys.rb +65 -0
  165. data/test/unit/test_mongo_mapper.rb +143 -0
  166. data/test/unit/test_pagination.rb +11 -0
  167. data/test/unit/test_plugins.rb +89 -0
  168. data/test/unit/test_rails.rb +183 -0
  169. data/test/unit/test_rails_compatibility.rb +38 -0
  170. data/test/unit/test_rails_reflect_on_association.rb +118 -0
  171. data/test/unit/test_railtie.rb +66 -0
  172. data/test/unit/test_serialization.rb +166 -0
  173. data/test/unit/test_time_zones.rb +44 -0
  174. data/test/unit/test_translation.rb +27 -0
  175. data/test/unit/test_validations.rb +562 -0
  176. metadata +285 -0
@@ -0,0 +1,28 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class ManyDocumentsAsProxy < ManyDocumentsProxy
6
+ protected
7
+ def criteria
8
+ {type_key_name => proxy_owner.class.name, id_key_name => proxy_owner.id}
9
+ end
10
+
11
+ def apply_scope(doc)
12
+ ensure_owner_saved
13
+ criteria.each { |key, value| doc[key] = value }
14
+ doc
15
+ end
16
+
17
+ private
18
+ def type_key_name
19
+ "#{options[:as]}_type"
20
+ end
21
+
22
+ def id_key_name
23
+ "#{options[:as]}_id"
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,118 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class ManyDocumentsProxy < Collection
6
+ include DynamicQuerying::ClassMethods
7
+
8
+ def_delegators :query, *(Querying::Methods - [:to_a, :size, :empty?])
9
+
10
+ def replace(docs)
11
+ load_target
12
+
13
+ (target - docs).each do |t|
14
+ case options[:dependent]
15
+ when :destroy then t.destroy
16
+ when :delete_all then t.delete
17
+ else t.update_attributes(self.foreign_key => nil)
18
+ end
19
+ end
20
+
21
+ docs.each { |doc| prepare(doc).save }
22
+ reset
23
+ end
24
+
25
+ def <<(*docs)
26
+ ensure_owner_saved
27
+ flatten_deeper(docs).each { |doc| prepare(doc).save }
28
+ reset
29
+ end
30
+ alias_method :push, :<<
31
+ alias_method :concat, :<<
32
+
33
+ def build(attrs={})
34
+ doc = klass.new(attrs)
35
+ apply_scope(doc)
36
+ @target ||= [] unless loaded?
37
+ @target << doc
38
+ doc
39
+ end
40
+
41
+ def create(attrs={})
42
+ doc = klass.new(attrs)
43
+ apply_scope(doc).save
44
+ reset
45
+ doc
46
+ end
47
+
48
+ def create!(attrs={})
49
+ doc = klass.new(attrs)
50
+ apply_scope(doc).save!
51
+ reset
52
+ doc
53
+ end
54
+
55
+ def destroy_all(options={})
56
+ all(options).each { |doc| doc.destroy }
57
+ reset
58
+ end
59
+
60
+ def delete_all(options={})
61
+ query(options).remove
62
+ reset
63
+ end
64
+
65
+ def nullify
66
+ all.each { |doc| doc.update_attributes(self.foreign_key => nil) }
67
+ reset
68
+ end
69
+
70
+ def save_to_collection(options={})
71
+ @target.each { |doc| doc.save(options) } if @target
72
+ end
73
+
74
+ protected
75
+ def query(options={})
76
+ klass.
77
+ query(association.query_options).
78
+ amend(options).amend(criteria)
79
+ end
80
+
81
+ def method_missing(method, *args, &block)
82
+ if klass.respond_to?(method)
83
+ result = klass.send(method, *args, &block)
84
+ result.is_a?(Plucky::Query) ?
85
+ query.merge(result) : super
86
+ else
87
+ super
88
+ end
89
+ end
90
+
91
+ def criteria
92
+ {self.foreign_key => proxy_owner.id}
93
+ end
94
+
95
+ def find_target
96
+ all
97
+ end
98
+
99
+ def ensure_owner_saved
100
+ proxy_owner.save unless proxy_owner.persisted?
101
+ end
102
+
103
+ def prepare(doc)
104
+ klass === doc ? apply_scope(doc) : build(doc)
105
+ end
106
+
107
+ def apply_scope(doc)
108
+ criteria.each { |key, value| doc[key] = value }
109
+ doc
110
+ end
111
+
112
+ def foreign_key
113
+ options[:foreign_key] || proxy_owner.class.name.foreign_key
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,32 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class ManyEmbeddedPolymorphicProxy < EmbeddedCollection
6
+ def replace(values)
7
+ @_values = values.map do |v|
8
+ v.respond_to?(:attributes) ? v.attributes.merge(association.type_key_name => v.class.name) : v
9
+ end
10
+ reset
11
+ end
12
+
13
+ protected
14
+ def find_target
15
+ (@_values || []).map do |hash|
16
+ child = polymorphic_class(hash).load(hash)
17
+ assign_references(child)
18
+ child
19
+ end
20
+ end
21
+
22
+ def polymorphic_class(doc)
23
+ if class_name = doc[association.type_key_name]
24
+ class_name.constantize
25
+ else
26
+ klass
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,24 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class ManyEmbeddedProxy < EmbeddedCollection
6
+ def replace(values)
7
+ @_values = (values || []).map do |v|
8
+ v.respond_to?(:attributes) ? v.attributes : v
9
+ end
10
+ reset
11
+ end
12
+
13
+ private
14
+ def find_target
15
+ (@_values || []).map do |attrs|
16
+ klass.load(attrs).tap do |child|
17
+ assign_references(child)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,14 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class ManyPolymorphicProxy < ManyDocumentsProxy
6
+ private
7
+ def apply_scope(doc)
8
+ doc[association.type_key_name] = doc.class.name
9
+ super
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,22 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class OneAsProxy < OneProxy
6
+ protected
7
+ def criteria
8
+ {type_key_name => proxy_owner.class.name, id_key_name => proxy_owner.id}
9
+ end
10
+
11
+ private
12
+ def type_key_name
13
+ "#{options[:as]}_type"
14
+ end
15
+
16
+ def id_key_name
17
+ "#{options[:as]}_id"
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,48 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class OneAssociation < SingleAssociation
6
+ def embeddable?
7
+ klass.embeddable?
8
+ end
9
+
10
+ def proxy_class
11
+ @proxy_class ||=
12
+ if klass.embeddable?
13
+ polymorphic? ? OneEmbeddedPolymorphicProxy : OneEmbeddedProxy
14
+ elsif as?
15
+ OneAsProxy
16
+ else
17
+ OneProxy
18
+ end
19
+ end
20
+
21
+ def setup(model)
22
+ super
23
+
24
+ association = self
25
+ options = self.options
26
+
27
+ model.before_destroy do
28
+ if !association.embeddable?
29
+ proxy = self.get_proxy(association)
30
+
31
+ unless proxy.nil?
32
+ case options[:dependent]
33
+ when :destroy then proxy.destroy
34
+ when :delete then proxy.delete
35
+ else proxy.nullify
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ def autosave?
43
+ options.fetch(:autosave, embeddable?)
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,30 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class OneEmbeddedPolymorphicProxy < OneEmbeddedProxy
6
+ def replace(value)
7
+ @value = value.respond_to?(:attributes) ? value.attributes.merge(association.type_key_name => value.class.name) : value
8
+ reset
9
+ end
10
+
11
+ protected
12
+ def find_target
13
+ if @value
14
+ child = polymorphic_class(@value).load(@value)
15
+ assign_references(child)
16
+ child
17
+ end
18
+ end
19
+
20
+ def polymorphic_class(doc)
21
+ if class_name = doc[association.type_key_name]
22
+ class_name.constantize
23
+ else
24
+ klass
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,44 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class OneEmbeddedProxy < Proxy
6
+ def build(attributes={})
7
+ @target = klass.new(attributes)
8
+ assign_references(@target)
9
+ loaded
10
+ @target
11
+ end
12
+
13
+ def replace(doc)
14
+ if doc.respond_to?(:attributes)
15
+ @target = klass.load(doc.attributes)
16
+ else
17
+ @target = klass.load(doc)
18
+ end
19
+ assign_references(@target)
20
+ loaded
21
+ @target
22
+ end
23
+
24
+ def save_to_collection(options={})
25
+ @target.persist(options) if @target
26
+ end
27
+
28
+ protected
29
+
30
+ def find_target
31
+ if @value
32
+ klass.load(@value).tap do |child|
33
+ assign_references(child)
34
+ end
35
+ end
36
+ end
37
+
38
+ def assign_references(doc)
39
+ doc._parent_document = proxy_owner if doc
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,95 @@
1
+ # encoding: UTF-8
2
+ module MongoMapper
3
+ module Plugins
4
+ module Associations
5
+ class OneProxy < Proxy
6
+ def build(attrs={})
7
+ instantiate_target(:new, attrs)
8
+ end
9
+
10
+ def create(attrs={})
11
+ instantiate_target(:create, attrs)
12
+ end
13
+
14
+ def create!(attrs={})
15
+ instantiate_target(:create!, attrs)
16
+ end
17
+
18
+ def replace(doc)
19
+ load_target
20
+
21
+ if !target.nil? && target != doc
22
+ if target.persisted?
23
+ case options[:dependent]
24
+ when :delete then target.delete
25
+ when :destroy then target.destroy
26
+ else
27
+ nullify_scope(target)
28
+ target.save
29
+ end
30
+ end
31
+ end
32
+
33
+ unless doc.nil?
34
+ proxy_owner.save unless proxy_owner.persisted?
35
+ doc = klass.new(doc) unless doc.is_a?(klass)
36
+ apply_scope(doc)
37
+ doc.save unless doc.persisted?
38
+ end
39
+
40
+ loaded
41
+ @target = doc
42
+ end
43
+
44
+ def destroy
45
+ target.destroy
46
+ reset
47
+ end
48
+
49
+ def delete
50
+ target.delete
51
+ reset
52
+ end
53
+
54
+ def nullify
55
+ nullify_scope(target)
56
+ target.save
57
+ reset
58
+ end
59
+
60
+ protected
61
+ def find_target
62
+ target_class.first(association.query_options.merge(criteria))
63
+ end
64
+
65
+ def instantiate_target(instantiator, attrs={})
66
+ @target = target_class.send(instantiator, attrs.update(criteria))
67
+ loaded
68
+ @target
69
+ end
70
+
71
+ def target_class
72
+ @target_class ||= options[:class] || (options[:class_name] || association.name.to_s.camelize).constantize
73
+ end
74
+
75
+ def foreign_key
76
+ options[:foreign_key] || proxy_owner.class.name.foreign_key
77
+ end
78
+
79
+ def criteria
80
+ {self.foreign_key => proxy_owner.id}
81
+ end
82
+
83
+ def nullify_scope(doc)
84
+ criteria.each { |key, value| doc[key] = nil }
85
+ doc
86
+ end
87
+
88
+ def apply_scope(doc)
89
+ criteria.each { |key, value| doc[key] = value }
90
+ doc
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end