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

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ UpdateWorkflowTestRequest

Returns a new instance of UpdateWorkflowTestRequest.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/retab/workflow_tests/update_workflow_test_request.rb', line 20

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