Class: PriceHubble::Valuation

Inherits:
BaseEntity show all
Defined in:
lib/pricehubble/entity/valuation.rb

Overview

The PriceHubble valuation result for a given property.

Instance Attribute Summary

Attributes inherited from BaseEntity

#_unmapped

Instance Method Summary collapse

Methods inherited from BaseEntity

inherited, #initialize

Constructor Details

This class inherits a constructor from PriceHubble::BaseEntity

Instance Method Details

#valueInteger?

A streamlined helper to get the value by the deal type. (sale price if deal type is sale or gross rent value if deal type is rent)

Returns:

  • (Integer, nil)

    the value of the property



32
33
34
35
36
# File 'lib/pricehubble/entity/valuation.rb', line 32

def value
  return sale_price if deal_type.sale?

  rent_gross
end

#value_rangeRange?

A streamlined helper to get the value range by the deal type. (sale price range if deal type is sale or gross rent range if deal type is rent)

Returns:

  • (Range, nil)

    the value range of the property



42
43
44
45
46
# File 'lib/pricehubble/entity/valuation.rb', line 42

def value_range
  return sale_price_range if deal_type.sale?

  rent_gross_range
end