Sha256: 160e34fbb84001a13b2ada67e300b75d45a8fefdec234121ca1e1298c4e12761

Contents?: true

Size: 903 Bytes

Versions: 7

Compression:

Stored size: 903 Bytes

Contents

require 'real_page/request_section'

module RealPage
  module RequestSection
    # Generate the list criteria section of a RealPage request
    class GetRentMatrix
      def initialize(lease_term:, need_by_date:, unit_ids:, viewing_quote_only:)
        @lease_term = lease_term
        @need_by_date = need_by_date
        @unit_ids = unit_ids
        @viewing_quote_only = viewing_quote_only
      end

      def generate(xml_builder)
        xml_builder.getrentmatrix do
          xml_builder.NeededByDate need_by_date
          xml_builder.LeaseTerm lease_term
          xml_builder.unitids do
            unit_ids.each do |unit_id|
              xml_builder.int unit_id
            end
          end
          xml_builder.viewingQuoteOnly viewing_quote_only ? 1 : 0
        end
      end

      private

      attr_reader :lease_term, :need_by_date, :unit_ids, :viewing_quote_only
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
real_page-2.3.6 lib/real_page/request_section/get_rent_matrix.rb
real_page-2.3.5 lib/real_page/request_section/get_rent_matrix.rb
real_page-2.3.4 lib/real_page/request_section/get_rent_matrix.rb
real_page-2.3.3 lib/real_page/request_section/get_rent_matrix.rb
real_page-2.3.2 lib/real_page/request_section/get_rent_matrix.rb
real_page-2.3.1 lib/real_page/request_section/get_rent_matrix.rb
real_page-2.3.0 lib/real_page/request_section/get_rent_matrix.rb