require 'real_page/document_parser/rent_matrices' require 'real_page/request_section/get_rent_matrix' require_relative 'base' module RealPage module Request # Retrieve pricing data for units in a property. # # Required intializer parameters: # # @param least_term [Integer] Proposed lease term duration, in months # @param need_by_date [Date] Proposed date when prospect would move in to # any apartment # @param pmc_id [String] the unique identifier for the property management # company in RealPage # @param site_id [String] the unique identifier for the property in RealPage # @param unit_ids [Array] Array of integer Unit ID numbers # as acquired from GetUnitsByProperty # @param viewing_quote_only [true|false] Identifies whether the user is # viewing or creating new quote class GetRentMatrix < Base private attr_reader :lease_term, :need_by_date, :unit_ids, :viewing_quote_only def after_initialize(params) %i[ lease_term need_by_date unit_ids viewing_quote_only ].each do |required_param| unless params[required_param] raise ArgumentError, "Params must include :#{required_param}" end instance_variable_set("@#{required_param}", params[required_param]) end end def sections [ RequestSection::GetRentMatrix.new( lease_term: lease_term, need_by_date: need_by_date, unit_ids: unit_ids, viewing_quote_only: viewing_quote_only ) ] end def parser DocumentParser::RentMatrices.new end end end end