k_doc 0.0.10 → 0.0.11
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 +4 -4
- data/lib/k_doc/container.rb +21 -9
- data/lib/k_doc/data.rb +0 -8
- data/lib/k_doc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3a22296c27473f92f9012c2c58c341cd622041f4f54b853cd098e667e2bd861
|
4
|
+
data.tar.gz: 1a39ea8f5f79db0a05204f18b6e070f2083d1bbd756b17ca24de7e0c77208c43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d66c94012e5dfed8899f89abdfaf8fd2ae13c3a35b8c31e77b45555d1ce539b66f88ca61fd56b42db6d2c9184c58d6df7cfc14949a40d30e5238e15e9bb5fa42
|
7
|
+
data.tar.gz: cb190abbb8f67ad7421a72474245ddaaa44901c70d6f4fd09cdfe7b325b759ff353fd30199396680751b2025a9a6f364a1043480c32551b885038dc7d101ad40
|
data/lib/k_doc/container.rb
CHANGED
@@ -17,15 +17,21 @@ module KDoc
|
|
17
17
|
# Any container can be uniquely identified via it's
|
18
18
|
# key, type, namespace and project_key attributes
|
19
19
|
#
|
20
|
-
# @param [
|
21
|
-
# @
|
22
|
-
# @
|
23
|
-
# @
|
24
|
-
|
25
|
-
|
26
|
-
@
|
27
|
-
@
|
28
|
-
@
|
20
|
+
# @param [Hash] **opts The options
|
21
|
+
# @option opts [String|Symbol] name Name of the container
|
22
|
+
# @option opts [String|Symbol] type Type of the container, defaults to KDoc:: FakeOpinion.new.default_document_type if not set
|
23
|
+
# @option opts [String|Symbol] namespace Namespace that the container belongs to
|
24
|
+
# @option opts [String|Symbol] project_key Project that the container belongs to
|
25
|
+
def initialize(**opts)
|
26
|
+
@key = opts[:key] || SecureRandom.alphanumeric(8)
|
27
|
+
@type = opts[:type] || KDoc.opinion.default_document_type
|
28
|
+
@namespace = opts[:namespace] || ''
|
29
|
+
@project_key = opts[:project_key] || ''
|
30
|
+
|
31
|
+
# Old name is default_data, wonder if I still need that idea?
|
32
|
+
# Most documents live within a hash, some tabular documents such as CSV will use an []
|
33
|
+
# @data = slice_option(:default_data) || {}
|
34
|
+
@data = opts[:data] || {}
|
29
35
|
end
|
30
36
|
|
31
37
|
def unique_key
|
@@ -39,5 +45,11 @@ module KDoc
|
|
39
45
|
log.kv 'project_key', namespace
|
40
46
|
log.kv 'error', error
|
41
47
|
end
|
48
|
+
|
49
|
+
attr_writer :data
|
50
|
+
|
51
|
+
def data
|
52
|
+
@data.clone
|
53
|
+
end
|
42
54
|
end
|
43
55
|
end
|
data/lib/k_doc/data.rb
CHANGED
data/lib/k_doc/version.rb
CHANGED