declarative 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: 777087a37a008f6db451fe0d998180119cef3a43
4
- data.tar.gz: 9dc8ca151863c9c438c9fd45f3784472c0270e7e
3
+ metadata.gz: 8fdc4811d1bc11bebe8a39516580f1e7e5969212
4
+ data.tar.gz: f12960019b725cf6337073927796867987030e2e
5
5
  SHA512:
6
- metadata.gz: 3ad76a30355469122e73ef454c393f6f1827648687b5a507f7e066100be68c180562133cae14b37160313e92cecb8838d437b9da3dcac38d037f5b86d9645819
7
- data.tar.gz: a1a0cd8836cdd1eb93da1dd0ea5d782cc39fc82f650625f26ec550e9430e7ccc8438ef5a41fefef11add1336c320fd889e97367ee2c302ea56ada71732cb56e5
6
+ metadata.gz: 7bf1836d15d1a5953b37d299e40f8213a1b774f4026d87b28ed0a37eb05e3c325f81aa543d2de607569578ce215a53b680c1a27420eed5c3b752a4fb26afe8d0
7
+ data.tar.gz: 83bee84f05b7fe7331e7d745aecf124fbe8c152f480cd5c51698bc172c1f0fb8058833f6c1d1f6ff4fd2e593934a41d68feee6a36d20d8445c1e6a7c5c788925
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.5
2
+
3
+ * Introduce `Schema::build_definition` as a central entry point for building `Definition` without any heritage involved.
4
+
1
5
  # 0.0.4
2
6
 
3
7
  * Restructured modules, there's always a public `DSL` module now, etc.
@@ -20,6 +20,7 @@ module Declarative
20
20
  end
21
21
  end
22
22
 
23
+
23
24
  def initialize(definition_class)
24
25
  @definition_class = definition_class
25
26
  super()
@@ -21,12 +21,7 @@ module Declarative
21
21
  def property(name, options={}, &block)
22
22
  heritage.record(:property, name, options, &block)
23
23
 
24
- default_options = {}
25
- default_options[:_base] = default_nested_class
26
- default_options[:_defaults] = _defaults
27
- default_options[:_nested_builder] = nested_builder if block
28
-
29
- definitions.add(name, default_options.merge(options), &block)
24
+ build_definition(name, options, &block)
30
25
  end
31
26
 
32
27
  def defaults(options={}, &block)
@@ -44,6 +39,15 @@ module Declarative
44
39
  end
45
40
 
46
41
  private
42
+ def build_definition(name, options={}, &block)
43
+ default_options = {}
44
+ default_options[:_base] = default_nested_class
45
+ default_options[:_defaults] = _defaults
46
+ default_options[:_nested_builder] = nested_builder if block
47
+
48
+ definitions.add(name, default_options.merge(options), &block)
49
+ end
50
+
47
51
  def _defaults
48
52
  @defaults ||= Declarative::Defaults.new
49
53
  end
@@ -1,3 +1,3 @@
1
1
  module Declarative
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: declarative
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-03 00:00:00.000000000 Z
11
+ date: 2015-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uber