Class: PriceHubble::ValuationRequest

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

Overview

The PriceHubble valuation request for one or more properties.

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

#perform(**args) ⇒ Array<PriceHubble::Valuation>

Perform the property valuation request.

Parameters:

  • args (Hash{Symbol => Mixed})

    additional options

Returns:



53
54
55
# File 'lib/pricehubble/entity/valuation_request.rb', line 53

def perform(**args)
  client.property_value(self, **args) || []
end

#sanitize_attr_key_propertiesSymbol

For transportation the properties array name must be changed to reflect the actual API specification.

Returns:

  • (Symbol)

    the sanitized name of the properties array



37
38
39
# File 'lib/pricehubble/entity/valuation_request.rb', line 37

def sanitize_attr_key_properties
  :valuation_inputs
end

#sanitize_attr_propertiesArray<Hash{String => Mixed}>

For transportation the properties array must be sanitized to reflect the actual API specification.

Returns:

  • (Array<Hash{String => Mixed}>)

    the sanitized properties



45
46
47
# File 'lib/pricehubble/entity/valuation_request.rb', line 45

def sanitize_attr_properties
  properties.map { |prop| { property: prop.attributes(sanitize: true) } }
end