Method: Html2rss::AttributePostProcessors::Substring#range

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

#rangeRange

Determines the range for the substring extraction based on the provided start and end indices.

Returns:

  • (Range)

    The range object representing the start and end/Infinity (integers).



54
55
56
57
58
59
60
61
62
63
# File 'lib/html2rss/attribute_post_processors/substring.rb', line 54

def range
  return (start_index..) unless end_index?

  if start_index == end_index
    raise ArgumentError,
          'The `start` value must be unequal to the `end` value.'
  end

  (start_index..end_index)
end