Sha256: b520fa6375c467080bd38e8617bfcc820d8b74659aa11fc72f22faf1af94c67d

Contents?: true

Size: 720 Bytes

Versions: 4

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

require 'housecanary/api/helpers'
require 'housecanary/api/sales_history'

module Housecanary
  module API
    class Repository
      include Housecanary::API::Helpers
      include Housecanary::AutoInject['connection', 'response_parser']

      SALES_HISTORY_PATH = 'property/sales_history'

      def sales_history(params = {})
        if response = perform_response(:get, SALES_HISTORY_PATH, params)
          SalesHistory.new(response&.first&.fetch("property/sales_history".to_sym, nil))
        end
      end

      private

      def perform_response(method, path, params = {})
        _perform_response(response_parser, connection, method, path, params)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
housecanary-ruby-0.1.3 lib/housecanary/api/repository.rb
housecanary-ruby-0.1.2 lib/housecanary/api/repository.rb
housecanary-ruby-0.1.1 lib/housecanary/api/repository.rb
housecanary-ruby-0.1.0 lib/housecanary/api/repository.rb