Class: Retab::UpdateWorkflowTestRequest

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_tests/update_workflow_test_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  name: :name,
  assertion: :assertion,
  source: :source
}.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) ⇒ UpdateWorkflowTestRequest

Returns a new instance of UpdateWorkflowTestRequest.



19
20
21
22
23
24
# File 'lib/retab/workflow_tests/update_workflow_test_request.rb', line 19

def initialize(json)
  hash = self.class.normalize(json)
  @name = hash[:name]
  @assertion = hash[:assertion] ? Retab::AssertionSpec.new(hash[:assertion]) : 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
end

Instance Attribute Details

#assertionObject

Returns the value of attribute assertion.



14
15
16
# File 'lib/retab/workflow_tests/update_workflow_test_request.rb', line 14

def assertion
  @assertion
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/retab/workflow_tests/update_workflow_test_request.rb', line 14

def name
  @name
end

#sourceObject

Returns the value of attribute source.



14
15
16
# File 'lib/retab/workflow_tests/update_workflow_test_request.rb', line 14

def source
  @source
end