Sha256: a76c70c06d55c868bf305f95d665387d898596906ab1d535c30bf30a3a01363b

Contents?: true

Size: 786 Bytes

Versions: 8

Compression:

Stored size: 786 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require_relative './config'

begin
  # Fetch the valuations for a single property (sale) for today (defaults).
  # This is the bare minimum variant, as a starting point.
  PriceHubble::ValuationRequest.new(
    property: {
      location: {
        address: {
          post_code: '22769',
          city: 'Hamburg',
          street: 'Stresemannstr.',
          house_number: '29'
        }
      },
      property_type: { code: :apartment },
      building_year: 2999,
      living_area: 200
    }
  ).perform!
rescue PriceHubble::EntityInvalid => e
  # => #<PriceHubble::EntityInvalid: buildingYear: ...>

  # The error message includes the detailed problem.
  pp e.message
  # => "buildingYear: Must be between 1850 and 2022."
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pricehubble-1.1.0 doc/examples/property_valuations_errors.rb
pricehubble-1.0.0 doc/examples/property_valuations_errors.rb
pricehubble-0.4.2 doc/examples/property_valuations_errors.rb
pricehubble-0.4.1 doc/examples/property_valuations_errors.rb
pricehubble-0.4.0 doc/examples/property_valuations_errors.rb
pricehubble-0.3.0 doc/examples/property_valuations_errors.rb
pricehubble-0.2.0 doc/examples/property_valuations_errors.rb
pricehubble-0.1.0 doc/examples/property_valuations_errors.rb