<commit_before>require 'rss/maker'
require 'rss/opds'

module RSS
  module Maker
    module OPDS
      module LinkBase
        class << self
          def included(base)
            super
            base.class_eval(<<-EOC, __FILE__, __LINE__ + 1)
              %w[facetGroup activeFacet].each do |attr|
                def_other_element attr
              end
              def_classed_elements 'opds_price', 'value', 'Prices'

              # @note Defined to prevent NoMethodError
              def setup_opds_prices(feed, current)
              end

              # @note Should provide this method as the one of a module
              def to_feed(feed, current)
                super # AtomLink#to_feed
                opds_prices.to_feed(feed, current.links.last)
              end
            EOC
          end
        end

        class Prices < Base
          def_array_element 'opds_price', nil, 'Price'

          class Price < Base
            %w[value currencycode].each do |attr|
              attr_accessor attr
            end

            def to_feed(feed, current)
              price = ::RSS::OPDS::Price.new
              price.value = value
              price.currencycode = currencycode
              current.opds_prices << price
              set_parent price, current
              setup_other_elements(feed)
            end

            private<commit_msg>Remove achieved todo comment<commit_after>require 'rss/maker'
require 'rss/opds'

module RSS
  module Maker
    module OPDS
      module LinkBase
        class << self
          def included(base)
            super
            base.class_eval(<<-EOC, __FILE__, __LINE__ + 1)
              %w[facetGroup activeFacet].each do |attr|
                def_other_element attr
              end
              def_classed_elements 'opds_price', 'value', 'Prices'

              # @note Defined to prevent NoMethodError
              def setup_opds_prices(feed, current)
              end

              def to_feed(feed, current)
                super # AtomLink#to_feed
                opds_prices.to_feed(feed, current.links.last)
              end
            EOC
          end
        end

        class Prices < Base
          def_array_element 'opds_price', nil, 'Price'

          class Price < Base
            %w[value currencycode].each do |attr|
              attr_accessor attr
            end

            def to_feed(feed, current)
              price = ::RSS::OPDS::Price.new
              price.value = value
              price.currencycode = currencycode
              current.opds_prices << price
              set_parent price, current
              setup_other_elements(feed)
            end

            private
{'fraction_non_alphanumeric': 0.06501662356852604, 'fraction_numerical': 0.0007388252678241596, 'mean_word_length': 1.417857142857143, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7620524', 'n_tokens_mistral': 727, 'n_tokens_neox': 704, 'n_words': 185}