immoscout 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/documentation.yml +39 -0
  3. data/.github/workflows/test.yml +63 -0
  4. data/.rspec +2 -1
  5. data/.rubocop.yml +23 -4
  6. data/.simplecov +12 -0
  7. data/.yardopts +6 -0
  8. data/Appraisals +1 -5
  9. data/CHANGELOG.md +14 -0
  10. data/Dockerfile +2 -3
  11. data/Envfile +0 -3
  12. data/Gemfile +1 -1
  13. data/Guardfile +44 -0
  14. data/LICENSE +1 -1
  15. data/Makefile +47 -17
  16. data/README.md +4 -4
  17. data/Rakefile +18 -2
  18. data/gemfiles/rails_5.2.gemfile +1 -1
  19. data/immoscout.gemspec +45 -44
  20. data/lib/immoscout/api/client.rb +5 -2
  21. data/lib/immoscout/api/connection.rb +12 -11
  22. data/lib/immoscout/api/request.rb +10 -5
  23. data/lib/immoscout/configuration.rb +15 -9
  24. data/lib/immoscout/errors/failed.rb +3 -0
  25. data/lib/immoscout/models/actions/attachment.rb +22 -9
  26. data/lib/immoscout/models/actions/contact.rb +7 -10
  27. data/lib/immoscout/models/actions/publish.rb +4 -4
  28. data/lib/immoscout/models/actions/real_estate.rb +12 -12
  29. data/lib/immoscout/models/apartment_buy.rb +4 -1
  30. data/lib/immoscout/models/base.rb +3 -1
  31. data/lib/immoscout/models/concerns/modelable.rb +8 -3
  32. data/lib/immoscout/models/concerns/propertiable.rb +8 -2
  33. data/lib/immoscout/models/concerns/renderable.rb +18 -5
  34. data/lib/immoscout/models/contact.rb +3 -1
  35. data/lib/immoscout/models/document.rb +3 -1
  36. data/lib/immoscout/models/house_buy.rb +4 -1
  37. data/lib/immoscout/models/parts/address.rb +3 -0
  38. data/lib/immoscout/models/parts/api_search_data.rb +3 -0
  39. data/lib/immoscout/models/parts/contact.rb +3 -0
  40. data/lib/immoscout/models/parts/coordinate.rb +3 -0
  41. data/lib/immoscout/models/parts/courtage.rb +3 -0
  42. data/lib/immoscout/models/parts/energy_certificate.rb +3 -0
  43. data/lib/immoscout/models/parts/energy_source.rb +3 -0
  44. data/lib/immoscout/models/parts/firing_type.rb +3 -0
  45. data/lib/immoscout/models/parts/geo_code.rb +3 -0
  46. data/lib/immoscout/models/parts/geo_hierarchy.rb +3 -0
  47. data/lib/immoscout/models/parts/international_country_region.rb +3 -0
  48. data/lib/immoscout/models/parts/price.rb +3 -0
  49. data/lib/immoscout/models/parts/publish_channel.rb +3 -0
  50. data/lib/immoscout/models/parts/real_estate.rb +3 -0
  51. data/lib/immoscout/models/parts/url.rb +3 -0
  52. data/lib/immoscout/models/parts/urls.rb +3 -0
  53. data/lib/immoscout/models/picture.rb +4 -2
  54. data/lib/immoscout/models/publish.rb +3 -1
  55. data/lib/immoscout/models.rb +2 -1
  56. data/lib/immoscout/version.rb +19 -1
  57. data/lib/immoscout.rb +2 -1
  58. metadata +99 -71
  59. data/.travis.yml +0 -23
  60. data/gemfiles/rails_6.0.gemfile +0 -7
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Immoscout
2
4
  module Api
5
+ # An abstract HTTP/API request.
3
6
  module Request
4
7
  def get(path, payload = nil, multipart = nil)
5
8
  request(:get, path, payload, multipart)
@@ -17,19 +20,21 @@ module Immoscout
17
20
  request(:delete, path, payload, multipart)
18
21
  end
19
22
 
23
+ # rubocop:disable Metrics/MethodLength because of the header handling
20
24
  def request(method, path, payload = nil, multipart = nil)
21
25
  connection.send(method, path, multipart) do |request|
22
26
  if multipart
23
- request.headers['Content-Type'] = "multipart/form-data"
27
+ request.headers['Content-Type'] = 'multipart/form-data'
24
28
  else
25
- request.body = payload if payload
26
- request.headers['Content-Type'] = "application/json;charset=UTF-8"
29
+ request.body = payload if payload
30
+ request.headers['Content-Type'] = 'application/json;charset=UTF-8'
27
31
  end
28
- request.headers['Accept'] = "application/json"
32
+ request.headers['Accept'] = 'application/json'
29
33
  request.headers['User-Agent'] = \
30
- "HausgoldImmoscout/#{Immoscout::VERSION}"
34
+ "RubyImmoscout/#{Immoscout::VERSION}"
31
35
  end
32
36
  end
37
+ # rubocop:enable Metrics/MethodLength
33
38
  end
34
39
  end
35
40
  end
@@ -1,27 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Immoscout
4
+ # The configuration object of the +immoscout+ gem.
4
5
  class Configuration
5
6
  include ActiveSupport::Configurable
6
- config_accessor(:consumer_key) { ENV["IMMOSCOUT_CONSUMER_KEY"] }
7
- config_accessor(:consumer_secret) { ENV["IMMOSCOUT_CONSUMER_SECRET"] }
8
7
 
9
- config_accessor(:oauth_token) { ENV["IMMOSCOUT_OAUTH_TOKEN"] }
10
- config_accessor(:oauth_token_secret) { ENV["IMMOSCOUT_OAUTH_TOKEN_SECRET"] }
8
+ config_accessor(:consumer_key) { ENV.fetch('IMMOSCOUT_CONSUMER_KEY', nil) }
9
+ config_accessor(:consumer_secret) do
10
+ ENV.fetch('IMMOSCOUT_CONSUMER_SECRET', nil)
11
+ end
12
+
13
+ config_accessor(:oauth_token) { ENV.fetch('IMMOSCOUT_OAUTH_TOKEN', nil) }
14
+ config_accessor(:oauth_token_secret) do
15
+ ENV.fetch('IMMOSCOUT_OAUTH_TOKEN_SECRET', nil)
16
+ end
11
17
 
12
18
  config_accessor(:use_sandbox) { false }
13
19
 
14
- config_accessor(:api_version) { "v1.0" }
20
+ config_accessor(:api_version) { 'v1.0' }
15
21
 
16
22
  config_accessor(:user_name) { 'me' }
17
23
 
18
24
  config_accessor(:api_url_live) do
19
- "https://rest.immobilienscout24.de/" \
20
- "restapi/api/offer/#{api_version}"
25
+ 'https://rest.immobilienscout24.de/' \
26
+ "restapi/api/offer/#{api_version}"
21
27
  end
22
28
  config_accessor(:api_url_sandbox) do
23
- "https://rest.sandbox-immobilienscout24.de/" \
24
- "restapi/api/offer/#{api_version}"
29
+ 'https://rest.sandbox-immobilienscout24.de/' \
30
+ "restapi/api/offer/#{api_version}"
25
31
  end
26
32
  end
27
33
  end
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Immoscout
2
4
  module Errors
5
+ # Representation of a failed API request/response.
3
6
  class Failed < StandardError
4
7
  def initialize(response)
5
8
  @status = response.status
@@ -1,9 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require_relative '../concerns/modelable'
3
5
 
6
+ # rubocop:disable Metrics/BlockLength because this is how an ActiveSupport
7
+ # concern looks like
4
8
  module Immoscout
5
9
  module Models
6
10
  module Actions
11
+ # Actions to work with attachments.
7
12
  module Attachment
8
13
  extend ActiveSupport::Concern
9
14
 
@@ -12,11 +17,14 @@ module Immoscout
12
17
 
13
18
  self.unpack_collection = proc do |hash|
14
19
  hash
15
- .fetch("common.attachments")
20
+ .fetch('common.attachments')
16
21
  .first
17
- .fetch("attachment")
22
+ .fetch('attachment')
18
23
  end
19
24
 
25
+ # rubocop:disable Metrics/AbcSize because this is the
26
+ # bare minimum logic
27
+ # rubocop:disable Metrics/MethodLength dito
20
28
  def save
21
29
  attachable_id = attachable.try(:id) || attachable
22
30
  response = api.post(
@@ -33,17 +41,21 @@ module Immoscout
33
41
  self.id = id_from_response(response)
34
42
  self
35
43
  end
44
+ # rubocop:enable Metrics/AbcSize
45
+ # rubocop:enable Metrics/MethodLength
36
46
 
37
47
  def destroy
38
48
  attachable_id = attachable.try(:id) || attachable
39
49
  response = api.delete(
40
- "user/#{api.user_name}/realestate/#{attachable_id}/attachment/#{id}",
50
+ "user/#{api.user_name}/" \
51
+ "realestate/#{attachable_id}/" \
52
+ "attachment/#{id}"
41
53
  )
42
54
  handle_response(response)
43
55
  self
44
56
  end
45
57
 
46
- private
58
+ protected
47
59
 
48
60
  def file_extension
49
61
  File.extname(file_name)
@@ -61,11 +73,11 @@ module Immoscout
61
73
  class_methods do
62
74
  def content_type_from_extension(ext)
63
75
  {
64
- ".jpg" => "image/jpeg",
65
- ".jpeg" => "image/jpeg",
66
- ".gif" => "image/gif",
67
- ".png" => "image/png",
68
- ".pdf" => "application/pdf"
76
+ '.jpg' => 'image/jpeg',
77
+ '.jpeg' => 'image/jpeg',
78
+ '.gif' => 'image/gif',
79
+ '.png' => 'image/png',
80
+ '.pdf' => 'application/pdf'
69
81
  }.fetch(ext)
70
82
  end
71
83
 
@@ -84,3 +96,4 @@ module Immoscout
84
96
  end
85
97
  end
86
98
  end
99
+ # rubocop:enable Metrics/BlockLength
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require_relative '../concerns/modelable'
3
5
 
4
6
  module Immoscout
5
7
  module Models
6
8
  module Actions
9
+ # Actions to work with contacts.
7
10
  module Contact
8
11
  extend ActiveSupport::Concern
9
12
 
@@ -12,8 +15,8 @@ module Immoscout
12
15
 
13
16
  self.unpack_collection = proc do |hash|
14
17
  hash
15
- .fetch("common.realtorContactDetailsList", {})
16
- .fetch("realtorContactDetails", nil)
18
+ .fetch('common.realtorContactDetailsList', {})
19
+ .fetch('realtorContactDetails', nil)
17
20
  end
18
21
 
19
22
  def save
@@ -54,14 +57,8 @@ module Immoscout
54
57
  objects = unpack_collection.call(response.body)
55
58
  objects.map { |object| new(object) }
56
59
  end
57
-
58
- def first
59
- all.first
60
- end
61
-
62
- def last
63
- all.last
64
- end
60
+ delegate :first, to: :all
61
+ delegate :last, to: :all
65
62
 
66
63
  def create(hash)
67
64
  instance = new(hash)
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require_relative '../concerns/modelable'
3
5
 
4
6
  module Immoscout
5
7
  module Models
6
8
  module Actions
9
+ # Actions to publish a Real Estate.
7
10
  module Publish
8
11
  extend ActiveSupport::Concern
9
12
 
@@ -11,7 +14,7 @@ module Immoscout
11
14
  include Immoscout::Models::Concerns::Modelable
12
15
 
13
16
  def save
14
- response = api.post("publish", as_json)
17
+ response = api.post('publish', as_json)
15
18
  handle_response(response)
16
19
  self
17
20
  end
@@ -24,9 +27,6 @@ module Immoscout
24
27
  self
25
28
  end
26
29
  end
27
-
28
- class_methods do
29
- end
30
30
  end
31
31
  end
32
32
  end
@@ -1,9 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require_relative '../concerns/modelable'
3
5
 
6
+ # rubocop:disable Metrics/BlockLength because this is how an ActiveSupport
7
+ # concern looks like
4
8
  module Immoscout
5
9
  module Models
6
10
  module Actions
11
+ # Actions to work with real estate objects.
7
12
  module RealEstate
8
13
  extend ActiveSupport::Concern
9
14
 
@@ -12,9 +17,9 @@ module Immoscout
12
17
 
13
18
  self.unpack_collection = proc do |hash|
14
19
  hash
15
- .fetch("realestates.realEstates", {})
16
- .fetch("realEstateList", {})
17
- .fetch("realEstateElement", nil)
20
+ .fetch('realestates.realEstates', {})
21
+ .fetch('realEstateList', {})
22
+ .fetch('realEstateElement', nil)
18
23
  end
19
24
 
20
25
  def save
@@ -72,7 +77,7 @@ module Immoscout
72
77
  self
73
78
  end
74
79
 
75
- private
80
+ protected
76
81
 
77
82
  def check_placement_type(type)
78
83
  raise ArgumentError, "Unknown placement type '#{type}'" unless %w[
@@ -101,14 +106,8 @@ module Immoscout
101
106
  .map { |object| new(object) }
102
107
  .select { |object| object.type =~ /#{name.demodulize}/i }
103
108
  end
104
-
105
- def first
106
- all.first
107
- end
108
-
109
- def last
110
- all.last
111
- end
109
+ delegate :first, to: :all
110
+ delegate :last, to: :all
112
111
 
113
112
  def create(hash)
114
113
  instance = new(hash)
@@ -120,3 +119,4 @@ module Immoscout
120
119
  end
121
120
  end
122
121
  end
122
+ # rubocop:enable Metrics/BlockLength
@@ -12,12 +12,15 @@ require_relative 'parts/energy_source'
12
12
 
13
13
  module Immoscout
14
14
  module Models
15
+ # Real Estate. (selling an apartment)
16
+ # See: https://bit.ly/3iH3DNL
17
+ # See: https://bit.ly/3H7mQkY
15
18
  class ApartmentBuy < Base
16
19
  include Immoscout::Models::Concerns::Renderable
17
20
  include Immoscout::Models::Concerns::Propertiable
18
21
  include Immoscout::Models::Actions::RealEstate
19
22
 
20
- self.json_wrapper = "realestates.apartmentBuy"
23
+ self.json_wrapper = 'realestates.apartmentBuy'
21
24
 
22
25
  property :id, alias: :@id
23
26
  property :external_id
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Immoscout
4
4
  module Models
5
+ # The base/abstract model.
5
6
  class Base
6
7
  attr_reader :base
7
8
 
@@ -10,7 +11,7 @@ module Immoscout
10
11
  set_properties
11
12
  end
12
13
 
13
- private
14
+ protected
14
15
 
15
16
  def prepared_hash
16
17
  base
@@ -27,6 +28,7 @@ module Immoscout
27
28
  # puts "#{self.class.name} - missing property '#{key}'"
28
29
  next
29
30
  end
31
+
30
32
  set_property(property, key, value)
31
33
  end
32
34
  end
@@ -1,8 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
 
3
5
  module Immoscout
4
6
  module Models
5
7
  module Concerns
8
+ # Provides base functionality to reference/map/(de)serialize
9
+ # models against the immoscout API.
6
10
  module Modelable
7
11
  extend ActiveSupport::Concern
8
12
 
@@ -37,16 +41,17 @@ module Immoscout
37
41
 
38
42
  def handle_response(response)
39
43
  return response if response.success?
44
+
40
45
  raise Immoscout::Errors::Failed, response
41
46
  end
42
47
 
43
48
  def id_from_response(response)
44
49
  response
45
50
  .body
46
- .fetch("common.messages")
51
+ .fetch('common.messages')
47
52
  .first
48
- .fetch("message", {})
49
- .fetch("id", nil)
53
+ .fetch('message', {})
54
+ .fetch('id', nil)
50
55
  end
51
56
  end
52
57
  end
@@ -1,6 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Immoscout
2
4
  module Models
3
5
  module Concerns
6
+ # Includes functionality to access and modify
7
+ # model attributes transparently.
4
8
  module Propertiable
5
9
  extend ActiveSupport::Concern
6
10
 
@@ -12,11 +16,12 @@ module Immoscout
12
16
  # :reek:ControlParameter - standard stuff, reek!
13
17
  # :reek:TooManyStatements
14
18
  def method_missing(method_name, *arguments, &block)
15
- if method_name =~ /build\_(\w+)/
19
+ if method_name =~ /build_(\w+)/
16
20
  match = Regexp.last_match(1).intern
17
21
  properties = self.class.properties
18
22
  coerce_klass = properties.fetch(match).fetch(:coerce, nil)
19
- return super if !properties.keys.include?(match) || !coerce_klass
23
+ return super if !properties.key?(match) || !coerce_klass
24
+
20
25
  send("#{match}=", coerce_klass.new)
21
26
  else
22
27
  super
@@ -36,6 +41,7 @@ module Immoscout
36
41
  class_methods do
37
42
  def property(name, **opts)
38
43
  attr_accessor(name)
44
+
39
45
  alias_name = opts.fetch(:alias, false)
40
46
  if alias_name
41
47
  alias_method alias_name, name
@@ -1,8 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
 
5
+ # rubocop:disable Metrics/BlockLength because this is how an ActiveSupport
6
+ # concern looks like
3
7
  module Immoscout
4
8
  module Models
5
9
  module Concerns
10
+ # Includes functionality to serialize a Ruby model properly.
6
11
  module Renderable
7
12
  extend ActiveSupport::Concern
8
13
 
@@ -11,22 +16,28 @@ module Immoscout
11
16
  wrapped? ? to_json_wrapped : to_json_unwrapped
12
17
  end
13
18
 
14
- def to_json
19
+ def to_json(*)
15
20
  as_json.to_json
16
21
  end
17
22
  alias_method :to_s, :to_json
18
23
 
19
- private
24
+ protected
20
25
 
21
26
  def wrapped?
22
27
  self.class.try(:json_wrapper)
23
28
  end
24
29
 
30
+ # rubocop:disable Metrics/PerceivedComplexity because this is the
31
+ # bare minimum logic
32
+ # rubocop:disable Metrics/MethodLength dito
33
+ # rubocop:disable Metrics/CyclomaticComplexity dito
34
+ # rubocop:disable Metrics/AbcSize dito
25
35
  def to_h
26
36
  self.class.properties.each_with_object({}) do |(key, value), memo|
27
37
  # skip if it's readonly and should not be exposed in #as_json
28
38
  readonly = value.fetch(:readonly, false)
29
39
  next if readonly.try(:call, self) || readonly == true
40
+
30
41
  # use :alias instead of key as json-key
31
42
  property = value.fetch(:alias, key)
32
43
  # use :default if present AND value is nil
@@ -42,6 +53,10 @@ module Immoscout
42
53
  memo
43
54
  end
44
55
  end
56
+ # rubocop:enable Metrics/PerceivedComplexity
57
+ # rubocop:enable Metrics/MethodLength
58
+ # rubocop:enable Metrics/CyclomaticComplexity
59
+ # rubocop:enable Metrics/AbcSize
45
60
 
46
61
  def to_json_wrapped
47
62
  { self.class.try(:json_wrapper) => to_json_unwrapped }
@@ -54,10 +69,8 @@ module Immoscout
54
69
  .deep_transform_keys { |key| key.camelize :lower }
55
70
  end
56
71
  end
57
-
58
- class_methods do
59
- end
60
72
  end
61
73
  end
62
74
  end
63
75
  end
76
+ # rubocop:enable Metrics/BlockLength
@@ -7,12 +7,14 @@ require_relative 'parts/address'
7
7
 
8
8
  module Immoscout
9
9
  module Models
10
+ # A contact.
11
+ # See: https://bit.ly/3WcYquD
10
12
  class Contact < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
13
15
  include Immoscout::Models::Actions::Contact
14
16
 
15
- self.json_wrapper = "common.realtorContactDetail"
17
+ self.json_wrapper = 'common.realtorContactDetail'
16
18
 
17
19
  property :id, alias: :@id
18
20
  property :email
@@ -6,6 +6,8 @@ require_relative 'actions/attachment'
6
6
 
7
7
  module Immoscout
8
8
  module Models
9
+ # Attachment (document) of a Real Estate.
10
+ # See: https://bit.ly/3Xx32gj
9
11
  class Document < Base
10
12
  include Immoscout::Models::Concerns::Renderable
11
13
  include Immoscout::Models::Concerns::Propertiable
@@ -13,7 +15,7 @@ module Immoscout
13
15
 
14
16
  attr_accessor :attachable, :file
15
17
 
16
- self.json_wrapper = "common.attachment"
18
+ self.json_wrapper = 'common.attachment'
17
19
 
18
20
  property :id, alias: :@id
19
21
  property :type, alias: :'@xsi.type'
@@ -14,12 +14,15 @@ require_relative 'parts/firing_type'
14
14
 
15
15
  module Immoscout
16
16
  module Models
17
+ # Real Estate. (selling a house)
18
+ # See: https://bit.ly/3iH3DNL
19
+ # See: https://bit.ly/3CSGnmN
17
20
  class HouseBuy < Base
18
21
  include Immoscout::Models::Concerns::Renderable
19
22
  include Immoscout::Models::Concerns::Propertiable
20
23
  include Immoscout::Models::Actions::RealEstate
21
24
 
22
- self.json_wrapper = "realestates.houseBuy"
25
+ self.json_wrapper = 'realestates.houseBuy'
23
26
 
24
27
  property :id, alias: :@id
25
28
  property :external_id
@@ -10,9 +10,12 @@ require_relative '../concerns/renderable'
10
10
  module Immoscout
11
11
  module Models
12
12
  module Parts
13
+ # Shared address-related property definitions.
14
+ # See: https://bit.ly/3CSGnmN
13
15
  class Address < Base
14
16
  include Immoscout::Models::Concerns::Renderable
15
17
  include Immoscout::Models::Concerns::Propertiable
18
+
16
19
  property :street
17
20
  property :house_number
18
21
  property :postcode
@@ -7,9 +7,12 @@ require_relative '../concerns/renderable'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Parts
10
+ # Shared search-related property definitions.
11
+ # See: https://bit.ly/3CSGnmN
10
12
  class ApiSearchData < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
15
+
13
16
  property :search_field1
14
17
  property :search_field2
15
18
  property :search_field3
@@ -7,9 +7,12 @@ require_relative '../concerns/renderable'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Parts
10
+ # Shared contact-related property definitions.
11
+ # See: https://bit.ly/3CSGnmN
10
12
  class Contact < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
15
+
13
16
  property :id, alias: :@id
14
17
  property :external_id, alias: :@external_id
15
18
  end
@@ -7,9 +7,12 @@ require_relative '../concerns/renderable'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Parts
10
+ # Shared coordinates-related property definitions.
11
+ # See: https://bit.ly/3CSGnmN
10
12
  class Coordinate < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
15
+
13
16
  property :latitude
14
17
  property :longitude
15
18
  end
@@ -7,9 +7,12 @@ require_relative '../concerns/renderable'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Parts
10
+ # Shared courtage-related property definitions.
11
+ # See: https://bit.ly/3CSGnmN
10
12
  class Courtage < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
15
+
13
16
  property :has_courtage
14
17
  property :courtage
15
18
  property :courtage_note
@@ -7,9 +7,12 @@ require_relative '../concerns/renderable'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Parts
10
+ # Shared energy-certificate-related property definitions.
11
+ # See: https://bit.ly/3CSGnmN
10
12
  class EnergyCertificate < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
15
+
13
16
  property :energy_certificate_availability
14
17
  property :energy_certificate_creation_date
15
18
  property :energy_efficiency_class
@@ -7,9 +7,12 @@ require_relative '../concerns/renderable'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Parts
10
+ # Shared energy-source-related property definitions.
11
+ # See: https://bit.ly/3CSGnmN
10
12
  class EnergySource < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
15
+
13
16
  property :energy_source_enev2014
14
17
  end
15
18
  end
@@ -7,9 +7,12 @@ require_relative '../concerns/renderable'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Parts
10
+ # Shared firing-type-related property definitions.
11
+ # See: https://bit.ly/3CSGnmN
10
12
  class FiringType < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
15
+
13
16
  property :firing_type
14
17
  end
15
18
  end
@@ -7,9 +7,12 @@ require_relative '../concerns/renderable'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Parts
10
+ # Shared geo-coding-related property definitions.
11
+ # See: https://bit.ly/3CSGnmN
10
12
  class GeoCode < Base
11
13
  include Immoscout::Models::Concerns::Renderable
12
14
  include Immoscout::Models::Concerns::Propertiable
15
+
13
16
  property :geo_code_id
14
17
  property :full_geo_code_id
15
18
  end
@@ -8,9 +8,12 @@ require_relative 'geo_code'
8
8
  module Immoscout
9
9
  module Models
10
10
  module Parts
11
+ # Shared geo-hierarchy-related property definitions.
12
+ # See: https://bit.ly/3CSGnmN
11
13
  class GeoHierarchy < Base
12
14
  include Immoscout::Models::Concerns::Renderable
13
15
  include Immoscout::Models::Concerns::Propertiable
16
+
14
17
  property :continent, coerce: Immoscout::Models::Parts::GeoCode
15
18
  property :country, coerce: Immoscout::Models::Parts::GeoCode
16
19
  property :region, coerce: Immoscout::Models::Parts::GeoCode