arc-furnace 0.1.5 → 0.1.6

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: 9df3a73be9dcc9895ac020fa90b19107913098a9
4
- data.tar.gz: c1cb5a2361519f5fbeaf559573cd8218888b2ac3
3
+ metadata.gz: b1e31764e5f441865318c740d42a2162f36281ee
4
+ data.tar.gz: ea0dabe542ab562dce4189275798188e9158ef5e
5
5
  SHA512:
6
- metadata.gz: fdcbef6297c18f2860a5c4e25ba30cfef1c2f60fb2b70cc801dd23d27b06c9692ba09ecb8721c57ae7929ab9d9d146fc3bd18d71dab6dcc83cea28049ca3327c
7
- data.tar.gz: 1d357cd76b76ab5f2982c5afb6a094892472eca16919dd34c13c959d1623bdc3dd93ed32549ebd9d8215b6fcd3a109dd61a3f9065989c3a8c2bd4a79ec3d131e
6
+ metadata.gz: 254ce32fb43a5c4d6f8b8d5228464197ceb097a5bfed2adc9f18c43a44e27f3b119b40a1ba95adfed0e715ed20db079e95c699d25c01e3756c9510e39ca97fd2
7
+ data.tar.gz: 9632ed4bdfec91b6afb163a9923253e66207c3b8cb0cd7dece084bd4f57777e1496c62429f07e688e4fdcf6c2826566cb065e2284df25c351d364ca3d97e7478
@@ -1,5 +1,5 @@
1
1
  module ArcFurnace
2
2
  class Node
3
- attr_accessor :error_handler, :node_id
3
+ attr_accessor :error_handler, :node_id, :params
4
4
  end
5
5
  end
@@ -99,9 +99,18 @@ module ArcFurnace
99
99
 
100
100
  private
101
101
 
102
+ ALLOWABLE_PARAM_TYPES = [:key, :keyreq].freeze
103
+
102
104
  def self.define_intermediate(node_id, type:, params:)
103
105
  intermediates_map[node_id] = -> do
104
- type.new(resolve_parameters(node_id, params))
106
+ resolved_params = resolve_parameters(node_id, params)
107
+ key_parameters = type.instance_method(:initialize).parameters do |param|
108
+ ALLOWABLE_PARAM_TYPES.include?(param.first)
109
+ end.map(&:second)
110
+ # Allow params to be passed that are not in the initializer
111
+ instance = type.new(resolved_params.slice(*key_parameters))
112
+ instance.params = resolved_params
113
+ instance
105
114
  end
106
115
  end
107
116
 
@@ -1,3 +1,3 @@
1
1
  module ArcFurnace
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arc-furnace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Spangenberger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-11-19 00:00:00.000000000 Z
12
+ date: 2015-11-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack