lib/rentlinx/modules/link_client_methods.rb
def post_links(links)
      return if links.nil?

      raise(Rentlinx::InvalidObject, links.find { |a| !a.valid? }) unless links.all?(&:valid?)
      raise(Rentlinx::IncompatibleGroupOfObjectsForPost, 'propertyID') unless links.all? { |p| p.propertyID == links.first.propertyID }

      property_links = links.select { |l| l.class == Rentlinx::PropertyLink }
      unit_links = links - property_links

      post_property_links(property_links) unless property_links.empty?
      post_unit_links(unit_links) unless unit_links.empty?
    end
# Posts an array of links to Rentlinx
#
# This uses the batch endpoint, so all links must be associated with
# the same property. They can be on different units, so long as all units
# are on the same property.
#
# @param links [Array] an array of links which all have the same propertyID
Posts an array of links to Rentlinx
This uses the batch endpoint, so all links must be associated with
the same property. They can be on different units, so long as all units
are on the same property.
Posts an array of links to Rentlinx This uses the batch endpoint so all links must be associated with the same property . They can be on different units so long as all units are on the same property .
def post_links(links)
      return if links.nil?
      raise(Rentlinx::InvalidObject, links.find { |a| !a.valid? }) unless links.all?(&:valid?)
      raise(Rentlinx::IncompatibleGroupOfObjectsForPost, 'propertyID') unless links.all? { |p| p.propertyID == links.first.propertyID }
      property_links = links.select { |l| l.class == Rentlinx::PropertyLink }
      unit_links = links - property_links
      post_property_links(property_links) unless property_links.empty?
      post_unit_links(unit_links) unless unit_links.empty?
    end
def post_links ( links ) return if links . nil? raise ( Rentlinx :: InvalidObject , links . find { | a | ! a . valid? } ) unless links . all? ( & :valid? ) raise ( Rentlinx :: IncompatibleGroupOfObjectsForPost , 'propertyID' ) unless links . all? { | p | p . propertyID == links . first . propertyID } property_links = links . select { | l | l . class == Rentlinx :: PropertyLink } unit_links = links - property_links post_property_links ( property_links ) unless property_links . empty? post_unit_links ( unit_links ) unless unit_links . empty? end
Posts an array of links to Rentlinx
This uses the batch endpoint, so all links must be associated with
the same property.
Posts an array of links to Rentlinx This uses the batch endpoint so all links must be associated with the same property .
links
an array of links which all have the same propertyID
an array of links which all have the same propertyID