Sha256: ac7e5c180537716dd78aa3c4443ef4d3186eec7ecdd2aa07b7dbfec107074638

Contents?: true

Size: 882 Bytes

Versions: 4

Compression:

Stored size: 882 Bytes

Contents

module Rentvine
  class Client
    module Inspections
      def inspections(args = {})
        results = process_request(:get, 'maintenance/inspections', params: args)
        return results if results.is_a?(RentvineError)

        results.map { |result| Rentvine::Inspection.new(result[:inspection]) }
      end
      alias list_inspections inspections

      def inspection(inspection_id)
        result = process_request(:get, "maintenance/inspections/#{inspection_id}")
        return result if result.is_a?(RentvineError)

        Rentvine::Inspection.new(result[:inspection])
      end

      def save_inspection(inspection_model)
        result = process_request(:post, '/maintenance/inspections', body: inspection_model.to_rentvine_hash)
        return result if result.is_a?(RentvineError)

        Rentvine::Inspection.new(result[:inspection])
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rentvine-0.3.1 lib/rentvine/client/inspections.rb
rentvine-0.3.0 lib/rentvine/client/inspections.rb
rentvine-0.2.0 lib/rentvine/client/inspections.rb
rentvine-0.1.0 lib/rentvine/client/inspections.rb