Class: Retab::CreateWorkflowTestRequest
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::CreateWorkflowTestRequest
- Defined in:
- lib/retab/workflow_tests/create_workflow_test_request.rb
Constant Summary collapse
- HASH_ATTRS =
{ workflow_id: :workflow_id, target: :target, source: :source, name: :name, assertion: :assertion }.freeze
Instance Attribute Summary collapse
-
#assertion ⇒ Object
Returns the value of attribute assertion.
-
#name ⇒ Object
Returns the value of attribute name.
-
#source ⇒ Object
Returns the value of attribute source.
-
#target ⇒ Object
Returns the value of attribute target.
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ CreateWorkflowTestRequest
constructor
A new instance of CreateWorkflowTestRequest.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ CreateWorkflowTestRequest
Returns a new instance of CreateWorkflowTestRequest.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/retab/workflow_tests/create_workflow_test_request.rb', line 24 def initialize(json) super() hash = self.class.normalize(json) @workflow_id = hash[:workflow_id] @target = hash[:target] ? Retab::WorkflowTestBlockTarget.new(hash[:target]) : nil @source = hash[:source] ? ( case hash[:source][:type] when "manual" Retab::ManualWorkflowTestSource.new(hash[:source]) when "run_step" Retab::RunStepWorkflowTestSource.new(hash[:source]) else hash[:source] end ) : nil @name = hash[:name] @assertion = hash[:assertion] ? Retab::AssertionSpec.new(hash[:assertion]) : nil end |
Instance Attribute Details
#assertion ⇒ Object
Returns the value of attribute assertion.
16 17 18 |
# File 'lib/retab/workflow_tests/create_workflow_test_request.rb', line 16 def assertion @assertion end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/retab/workflow_tests/create_workflow_test_request.rb', line 16 def name @name end |
#source ⇒ Object
Returns the value of attribute source.
16 17 18 |
# File 'lib/retab/workflow_tests/create_workflow_test_request.rb', line 16 def source @source end |
#target ⇒ Object
Returns the value of attribute target.
16 17 18 |
# File 'lib/retab/workflow_tests/create_workflow_test_request.rb', line 16 def target @target end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
16 17 18 |
# File 'lib/retab/workflow_tests/create_workflow_test_request.rb', line 16 def workflow_id @workflow_id end |