Class: DataDomeResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/model/api/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, score: nil, event_id: nil) ⇒ DataDomeResponse

Returns a new instance of DataDomeResponse.



28
29
30
31
32
33
# File 'lib/model/api/response.rb', line 28

def initialize(status:, score:nil, event_id:nil)
  @action = DataDomeResponseAction::ALLOW
  @status = status
  @score = score
  @event_id = event_id
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



26
27
28
# File 'lib/model/api/response.rb', line 26

def action
  @action
end

#event_idObject

Returns the value of attribute event_id.



26
27
28
# File 'lib/model/api/response.rb', line 26

def event_id
  @event_id
end

#scoreObject

Returns the value of attribute score.



26
27
28
# File 'lib/model/api/response.rb', line 26

def score
  @score
end

#statusObject

Returns the value of attribute status.



26
27
28
# File 'lib/model/api/response.rb', line 26

def status
  @status
end

Instance Method Details

#to_json(options = {}) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/model/api/response.rb', line 39

def to_json(options = {})
  {
    action: @action,
    score: @score,
    status: @status,
    event_id: @event_id,
  }.to_json
end

#to_sObject



35
36
37
# File 'lib/model/api/response.rb', line 35

def to_s
  "DataDomeResponse: action=#{@action}, score=#{@score}, status=#{@status}, event_id=#{@event_id}"
end