k_doc 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/k_doc/container.rb +2 -2
- data/lib/k_doc/fake_opinion.rb +2 -2
- data/lib/k_doc/model.rb +2 -2
- data/lib/k_doc/util.rb +1 -1
- 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: 64615008b76feb26a84e9dd808654495cf3f26bf42f6941b00eaca9013081a76
|
4
|
+
data.tar.gz: e69ccfb764c6dd9df4ee1fe78df56f717726f733184839020d3df968c34fde63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94d4cd31dddad2f142fa418c24025c866124722e8f93ee3133d1d7c68893640954c7203e5bd5a502eb75f9650c444d7103945af6fa901ece63450a0537b130d3
|
7
|
+
data.tar.gz: f1a6e045702b3e9c94146ae413f573fc281472eaf5927e9b27a819445cff112b2a688863c7f0bf2d2d4e996e703dd3f4f7721c7766ecd621feb4971b24cfddba
|
data/lib/k_doc/container.rb
CHANGED
@@ -27,12 +27,12 @@ module KDoc
|
|
27
27
|
#
|
28
28
|
# @param [Hash] **opts The options
|
29
29
|
# @option opts [String|Symbol] name Name of the container
|
30
|
-
# @option opts [String|Symbol] type Type of the container, defaults to KDoc:: FakeOpinion.new.
|
30
|
+
# @option opts [String|Symbol] type Type of the container, defaults to KDoc:: FakeOpinion.new.default_model_type if not set
|
31
31
|
# @option opts [String|Symbol] namespace Namespace that the container belongs to
|
32
32
|
# @option opts [String|Symbol] project_key Project that the container belongs to
|
33
33
|
def initialize(**opts)
|
34
34
|
@key = opts[:key] || SecureRandom.alphanumeric(4)
|
35
|
-
@type = opts[:type] || '' # KDoc.opinion.
|
35
|
+
@type = opts[:type] || '' # KDoc.opinion.default_model_type
|
36
36
|
# @namespace = opts[:namespace] || ''
|
37
37
|
# @project_key = opts[:project_key] || ''
|
38
38
|
|
data/lib/k_doc/fake_opinion.rb
CHANGED
@@ -6,7 +6,7 @@ module KDoc
|
|
6
6
|
# This is called fake opinion because I have not figured out
|
7
7
|
# how I want to implement this
|
8
8
|
class FakeOpinion
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :default_model_type
|
10
10
|
attr_accessor :default_settings_key
|
11
11
|
attr_accessor :default_table_key
|
12
12
|
|
@@ -15,7 +15,7 @@ module KDoc
|
|
15
15
|
attr_accessor :table_class
|
16
16
|
|
17
17
|
def initialize
|
18
|
-
@
|
18
|
+
@default_model_type = :entity
|
19
19
|
@default_settings_key = :settings
|
20
20
|
@default_table_key = :table
|
21
21
|
|
data/lib/k_doc/model.rb
CHANGED
@@ -22,10 +22,10 @@ module KDoc
|
|
22
22
|
# Create document
|
23
23
|
#
|
24
24
|
# @param [String|Symbol] name Name of the document
|
25
|
-
# @param args[0] Type of the document, defaults to KDoc:: FakeOpinion.new.
|
25
|
+
# @param args[0] Type of the document, defaults to KDoc:: FakeOpinion.new.default_model_type if not set
|
26
26
|
# @param default: Default value (using named params), as above
|
27
27
|
def initialize(key = nil, **options, &block)
|
28
|
-
super(key: key, type: options[:type], namespace: options[:namespace], project_key: options[:project_key])
|
28
|
+
super(key: key, type: options[:type] || KDoc.opinion.default_model_type) # , namespace: options[:namespace], project_key: options[:project_key])
|
29
29
|
initialize_attributes(**options)
|
30
30
|
|
31
31
|
@block = block if block_given?
|
data/lib/k_doc/util.rb
CHANGED
@@ -10,7 +10,7 @@ module KDoc
|
|
10
10
|
def build_unique_key(key, type = nil, namespace = nil, project_key = nil)
|
11
11
|
raise KDoc::Error, 'key is required when generating unique key' if key.nil? || key.empty?
|
12
12
|
|
13
|
-
type ||= KDoc.opinion.
|
13
|
+
type ||= KDoc.opinion.default_model_type
|
14
14
|
|
15
15
|
keys = [project_key, namespace, key, type].reject { |k| k.nil? || k == '' }.map { |k| k.to_s.gsub('_', '-') }
|
16
16
|
|
data/lib/k_doc/version.rb
CHANGED