Class: Fuik::TestHelpers::WebhookEventDouble

Inherits:
Object
  • Object
show all
Defined in:
lib/fuik/test_helpers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider, event_id, event_type, payload) ⇒ WebhookEventDouble

Returns a new instance of WebhookEventDouble.



12
13
14
15
16
17
# File 'lib/fuik/test_helpers.rb', line 12

def initialize(provider, event_id, event_type, payload)
  @provider = provider
  @event_id = event_id
  @event_type = event_type
  @payload = payload
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



10
11
12
# File 'lib/fuik/test_helpers.rb', line 10

def error
  @error
end

#event_idObject (readonly)

Returns the value of attribute event_id.



10
11
12
# File 'lib/fuik/test_helpers.rb', line 10

def event_id
  @event_id
end

#event_typeObject (readonly)

Returns the value of attribute event_type.



10
11
12
# File 'lib/fuik/test_helpers.rb', line 10

def event_type
  @event_type
end

#providerObject (readonly)

Returns the value of attribute provider.



10
11
12
# File 'lib/fuik/test_helpers.rb', line 10

def provider
  @provider
end

#statusObject (readonly)

Returns the value of attribute status.



10
11
12
# File 'lib/fuik/test_helpers.rb', line 10

def status
  @status
end

Instance Method Details

#failed!(error) ⇒ Object



27
28
29
30
# File 'lib/fuik/test_helpers.rb', line 27

def failed!(error)
  @status = "failed"
  @error = error.to_s
end

#payloadObject



19
20
21
# File 'lib/fuik/test_helpers.rb', line 19

def payload
  @payload.is_a?(Hash) ? @payload : {}
end

#processed!Object



23
24
25
# File 'lib/fuik/test_helpers.rb', line 23

def processed!
  @status = "processed"
end