Class: Smith::Workflow::PreparedStepDispatch
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Smith::Workflow::PreparedStepDispatch
- Defined in:
- lib/smith/workflow/prepared_step_dispatch.rb
Constant Summary collapse
- ATTRIBUTES =
%i[prepared_step token dispatch_digest].freeze
- MAX_ATTRIBUTE_ENTRIES =
8- MAX_SERIALIZED_BYTES =
8 * 1024
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ PreparedStepDispatch
constructor
A new instance of PreparedStepDispatch.
Constructor Details
#initialize(attributes) ⇒ PreparedStepDispatch
Returns a new instance of PreparedStepDispatch.
81 82 83 84 85 |
# File 'lib/smith/workflow/prepared_step_dispatch.rb', line 81 def initialize(attributes) super self.attributes.freeze freeze end |
Class Method Details
.deserialize(value) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/smith/workflow/prepared_step_dispatch.rb', line 24 def self.deserialize(value) attributes = parse_attributes(value) normalized = normalize_attributes(attributes) validate_attributes!(normalized) normalized[:prepared_step] = PreparedStep.deserialize(normalized[:prepared_step]) new(normalized) rescue JSON::ParserError, TypeError => e raise ArgumentError, "prepared-step dispatch is invalid: #{e.}" end |