Sha256: 03eaf9d5160d95ebe5cbf37857cb5f95e16f95bb5c3b878cc1683540391f7db7

Contents?: true

Size: 350 Bytes

Versions: 7

Compression:

Stored size: 350 Bytes

Contents

module Html2rss
  module AttributePostProcessors
    class Substring
      def initialize(value, options, _item)
        @value = value
        @options = options
      end

      def get
        ending = @options['end'].to_i.positive? ? @options['end'].to_i : @value.length
        @value[@options['start'].to_i..ending]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
html2rss-0.3.2 lib/html2rss/attribute_post_processors/substring.rb
html2rss-0.3.1 lib/html2rss/attribute_post_processors/substring.rb
html2rss-0.3.0 lib/html2rss/attribute_post_processors/substring.rb
html2rss-0.2.2 lib/html2rss/attribute_post_processors/substring.rb
html2rss-0.2.1 lib/html2rss/attribute_post_processors/substring.rb
html2rss-0.2.0 lib/html2rss/attribute_post_processors/substring.rb
html2rss-0.1.0 lib/html2rss/attribute_post_processors/substring.rb