flow_object 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
  SHA256:
3
- metadata.gz: 0612652b790e12566782ac7aede6677315ae05c773ca066afee9b39fd9ac4335
4
- data.tar.gz: ebf9b7de4d50e5003f83197f87a3557d831ee20c040947dedaf421d2c3ff73c6
3
+ metadata.gz: db5d4237447ea9da647afab9214f2a37e10e3446353933dd6dd9f929d1b4a021
4
+ data.tar.gz: 0ca51ffecc9b02fe9f6a92f9382b0a91d18812645e844cfc02e22dc95997e4a4
5
5
  SHA512:
6
- metadata.gz: 8f9a6e6cdd8aadba78d66c68a9014fe868927bf6b3f877f34650847162e6dfbe541a69dd779002e09f2799faab8f27799554777429c49d63afc8029318760eb4
7
- data.tar.gz: def73238080897d12e9d5d1c2aa501872fb9b0e5e6a770b15cb197108b6edd95b5bfa4d78a7a8dc6891a3c20ed6080ce0d7ecfc4e37a3a642ead55e8302eace2
6
+ metadata.gz: 2fe85a38185bc79f41c3000ca80e8079578e591317dede9a2615a632a3e5756eb0c50b6f9a2def175bf781d50d9c00c50a645c2b623b8e8796a7904a3bb3dcf4
7
+ data.tar.gz: a63a10e4d35e722f28cb641711509653c44dfc0763c8cee77fc9f3da7b790f6bf49cf5c1a945dbedb395261aaa4d7e87096e071b8f4dd602c5f43d22b20111ff
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flow_object (0.3.0)
4
+ flow_object (0.3.1)
5
5
  hospodar (~> 1)
6
6
 
7
7
  GEM
@@ -13,6 +13,7 @@ GEM
13
13
  docile (1.3.5)
14
14
  dry-inflector (0.2.0)
15
15
  hospodar (1.0.1)
16
+ dry-inflector (~> 0.1)
16
17
  json (2.5.1)
17
18
  method_source (1.0.0)
18
19
  dry-inflector (~> 0.1)
@@ -9,7 +9,7 @@ module FlowObject
9
9
  produces :stages, :inputs, :outputs
10
10
 
11
11
  class << self
12
- attr_reader :in, :out, :initial_values
12
+ attr_reader :in, :out
13
13
  end
14
14
 
15
15
  extend Forwardable
@@ -54,13 +54,8 @@ module FlowObject
54
54
  self
55
55
  end
56
56
 
57
- def accept(*values)
58
- @initial_values = values
59
- self
60
- end
61
-
62
- def call(flow: :main, &block)
63
- fo_resolve(fo_process(flow: flow, &block))
57
+ def call(input:, flow: :main, &block)
58
+ fo_resolve(fo_process(input, flow: flow, &block))
64
59
  end
65
60
 
66
61
  def flow(name = :main, &block)
@@ -73,8 +68,8 @@ module FlowObject
73
68
  false
74
69
  end
75
70
 
76
- def fo_process(flow: :main, &block)
77
- plan = fo_build_flow(flow, self.in, :input, fo_wrap_input)
71
+ def fo_process(input, flow: :main, &block)
72
+ plan = fo_build_flow(flow, self.in, :input, fo_wrap_input(input))
78
73
  callbacks = Callbacks.new(@callbacks_allowlist)
79
74
  block.call(callbacks) if block_given?
80
75
  Runner.new(plan, callbacks, method(:halt_flow?)).execute_plan
@@ -86,7 +81,7 @@ module FlowObject
86
81
  send(:"hospodar_execute_plan_for_#{flow}", plan)
87
82
  end
88
83
 
89
- def fo_wrap_input
84
+ def fo_wrap_input(*initial_values)
90
85
  return initial_values if self.in.nil?
91
86
 
92
87
  input_class = public_send(:"#{self.in}_input_class")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FlowObject
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flow_object
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
  - Andrii Baran
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-27 00:00:00.000000000 Z
11
+ date: 2021-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hospodar