Class: Itly::ValidationResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/itly/validation_response.rb

Overview

Contains the result of a validation

valid: [True/False] indicating if the validation succeeded or failed plugin_id: [String] an id identifying your plugin message: [String] the message you want to appear in the logs in case of error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(valid:, plugin_id:, message: '') ⇒ ValidationResponse

Create a new ValidationResponse object



17
18
19
20
21
# File 'lib/itly/validation_response.rb', line 17

def initialize(valid:, plugin_id:, message: '')
  @valid = valid
  @plugin_id = plugin_id
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



12
13
14
# File 'lib/itly/validation_response.rb', line 12

def message
  @message
end

#plugin_idObject (readonly)

Returns the value of attribute plugin_id.



12
13
14
# File 'lib/itly/validation_response.rb', line 12

def plugin_id
  @plugin_id
end

#validObject (readonly)

Returns the value of attribute valid.



12
13
14
# File 'lib/itly/validation_response.rb', line 12

def valid
  @valid
end

Instance Method Details

#inspectString

Inspect the object

Returns:

  • (String)

    the object description



37
38
39
# File 'lib/itly/validation_response.rb', line 37

def inspect
  to_s
end

#to_sString

Describe the object

Returns:

  • (String)

    the object description



28
29
30
# File 'lib/itly/validation_response.rb', line 28

def to_s
  "#<#{self.class.name}: valid: #{valid}, plugin_id: #{plugin_id}, message: #{message}>"
end