Class: Html2rss::Config::ValidationResult

Inherits:
Data
  • Object
show all
Defined in:
lib/html2rss/config.rb,
lib/html2rss/config.rb

Overview

Duck-compatible with Dry::Validation::Result for resolve-time outcomes (+#success?+, #errors#to_h). Used for parse failures so callers never see a Struct snowflake.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errors_hashObject (readonly)

Returns the value of attribute errors_hash

Returns:

  • the current value of errors_hash



19
20
21
# File 'lib/html2rss/config.rb', line 19

def errors_hash
  @errors_hash
end

#successObject (readonly)

Returns the value of attribute success

Returns:

  • the current value of success



19
20
21
# File 'lib/html2rss/config.rb', line 19

def success
  @success
end

Class Method Details

.parse_failure(message) ⇒ Html2rss::Config::ValidationResult

Parameters:

Returns:



28
29
30
# File 'lib/html2rss/config.rb', line 28

def self.parse_failure(message)
  new(success: false, errors_hash: { parse: [message] })
end

Instance Method Details

#errorsself

Returns:



38
# File 'lib/html2rss/config.rb', line 38

def errors = self

#success?Boolean

Returns:



34
# File 'lib/html2rss/config.rb', line 34

def success? = success

#to_hHash

Returns:



42
# File 'lib/html2rss/config.rb', line 42

def to_h = errors_hash