Class: Retab::CreateWorkflowTestRequest

Inherits:
Types::BaseModel show all
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

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ CreateWorkflowTestRequest

Returns a new instance of CreateWorkflowTestRequest.



23
24
25
26
27
28
29
30
# File 'lib/retab/workflow_tests/create_workflow_test_request.rb', line 23

def initialize(json)
  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" then Retab::ManualWorkflowTestSource.new(hash[:source]) when "run_step" then 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

#assertionObject

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

#nameObject

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

#sourceObject

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

#targetObject

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_idObject

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