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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b4d2d8600ef139ecfe4ebc33df2a6fec04f28d014b92dde485bd03c3f50fc9a
4
- data.tar.gz: 6395ffd44207e6d247ca612a5af8c610856185e1d6dc8d4034cfb9f4be5104e7
3
+ metadata.gz: 64615008b76feb26a84e9dd808654495cf3f26bf42f6941b00eaca9013081a76
4
+ data.tar.gz: e69ccfb764c6dd9df4ee1fe78df56f717726f733184839020d3df968c34fde63
5
5
  SHA512:
6
- metadata.gz: 6698d8bd459a9bc19ed6f3882258851a7779bf4be4eab13fed6cfd19870f2311b5f60ec618b1ddd6619e154c16da15f21f80bb4b4a5527d7e42d4ac71c254a02
7
- data.tar.gz: d5bb18b0271b810a1f795537d6a9ae430dc8f7d82f940be5cfbb6c1dc28b7916c0d7f279ccd8f42be4d35f53a2822d6e43b2280dfc1e7fe8a2f2fe35b8d0f47c
6
+ metadata.gz: 94d4cd31dddad2f142fa418c24025c866124722e8f93ee3133d1d7c68893640954c7203e5bd5a502eb75f9650c444d7103945af6fa901ece63450a0537b130d3
7
+ data.tar.gz: f1a6e045702b3e9c94146ae413f573fc281472eaf5927e9b27a819445cff112b2a688863c7f0bf2d2d4e996e703dd3f4f7721c7766ecd621feb4971b24cfddba
@@ -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.default_document_type if not set
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.default_document_type
35
+ @type = opts[:type] || '' # KDoc.opinion.default_model_type
36
36
  # @namespace = opts[:namespace] || ''
37
37
  # @project_key = opts[:project_key] || ''
38
38
 
@@ -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 :default_document_type
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
- @default_document_type = :entity
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.default_document_type if not set
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.default_document_type
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KDoc
4
- VERSION = '0.0.15'
4
+ VERSION = '0.0.16'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k_doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys