fabrique 0.3.0 → 0.3.1

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: 494331a7b6792524ef6015df1561d1491e2f8c42
4
- data.tar.gz: cb74ab2e30ffa97f9e6b4e7a13c189efcc3437a1
3
+ metadata.gz: 3796e9e745800e240d127f0672f1c8d22ab40745
4
+ data.tar.gz: 8a4ce3af7cfd0a4be962e95df662d15d2b2b15d2
5
5
  SHA512:
6
- metadata.gz: dd994b6430c7d1635b489928a0684caba53fcc64ceca9c6de2b8762e98c65655916e0ea41b8879bfda97cdfa973ab2b3c7d44d40959c023cf6f8c0763b6dd954
7
- data.tar.gz: b66bd347ef6fded060d9a48a99d117b945b8a1a46fe0667319acf709a140a1554108db5cd35b452182d3fb4e1f49221b83968713b81f11fc1ce5cd238562c3fe
6
+ metadata.gz: 04869a6c8850d01a46188df165ca99f04004943cd902c19e21fc97f53248f4248462435e7b74e4f0c6d66aca8f7fcbe530cddabfdf324578006bac48e60335e7
7
+ data.tar.gz: af63e7a6b236ba0bbb0cd3216604d2059072dedafe9f675eb342e16bead68fc2942a3369061edfa04666ae3a85d0769874d85cfda41cd5499a2e3d9c36e69868
@@ -6,7 +6,7 @@ module Fabrique
6
6
  def initialize(attrs = {})
7
7
  @id = attrs["id"]
8
8
  type_name = attrs["class"]
9
- @type = type_name.is_a?(Module) ? @type_name : Module.const_get(type_name)
9
+ @type = type_name.is_a?(Module) ? type_name : Module.const_get(type_name)
10
10
  @constructor_args = attrs["constructor_args"] || []
11
11
  @constructor_args = keywordify(@constructor_args) if @constructor_args.is_a?(Hash)
12
12
  @properties = attrs["properties"] || {}
@@ -15,7 +15,7 @@ module Fabrique
15
15
  end
16
16
 
17
17
  def dependencies
18
- (dependencies_of(@constructor_args) + dependencies_of(@properties)).uniq
18
+ (accumulate_dependencies(@constructor_args) + accumulate_dependencies(@properties)).uniq
19
19
  end
20
20
 
21
21
  def singleton?
@@ -28,12 +28,12 @@ module Fabrique
28
28
  args.inject({}) { |m, (k, v)| k = k.intern rescue k; m[k.intern] = v; m }
29
29
  end
30
30
 
31
- def dependencies_of(data, acc = [])
31
+ def accumulate_dependencies(data, acc = [])
32
32
  if data.is_a?(Hash)
33
- dependencies_of(data.values, acc)
33
+ accumulate_dependencies(data.values, acc)
34
34
  elsif data.is_a?(Array)
35
35
  data.each do |o|
36
- dependencies_of(o, acc)
36
+ accumulate_dependencies(o, acc)
37
37
  end
38
38
  elsif data.is_a?(BeanReference) or data.is_a?(BeanPropertyReference)
39
39
  acc << data
@@ -1,3 +1,3 @@
1
1
  module Fabrique
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fabrique
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheldon Hearn