Class: Dialogue::ConversationOptionsValidator::ValidationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/dialogue/conversation_options_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ValidationResult

Returns a new instance of ValidationResult.



19
20
21
# File 'lib/dialogue/conversation_options_validator.rb', line 19

def initialize(errors)
  @errors = errors.freeze
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



17
18
19
# File 'lib/dialogue/conversation_options_validator.rb', line 17

def errors
  @errors
end

Instance Method Details

#error_messagesObject



23
24
25
# File 'lib/dialogue/conversation_options_validator.rb', line 23

def error_messages
  @errors.join(", ")
end

#success?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/dialogue/conversation_options_validator.rb', line 27

def success?
  @errors.empty?
end