Method: Html2rss::AttributePostProcessors::ParseUri.validate_args!

Defined in:
lib/html2rss/attribute_post_processors/parse_uri.rb

.validate_args!(value, context) ⇒ Object

Raises:

  • (ArgumentError)


25
26
27
28
29
30
31
32
# File 'lib/html2rss/attribute_post_processors/parse_uri.rb', line 25

def self.validate_args!(value, context)
  url_types = [String, URI::HTTP, Addressable::URI].freeze

  assert_type(value, url_types, :value, context:)
  assert_type(context.config.url, url_types, :url, context:)

  raise ArgumentError, 'The `value` option is missing or empty.' if value.to_s.empty?
end