immoscout 1.3.2 → 1.5.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/documentation.yml +3 -2
  3. data/.github/workflows/release.yml +47 -0
  4. data/.github/workflows/test.yml +6 -5
  5. data/.rspec +2 -1
  6. data/.rubocop.yml +23 -4
  7. data/.simplecov +12 -0
  8. data/Appraisals +1 -5
  9. data/CHANGELOG.md +16 -0
  10. data/Dockerfile +2 -3
  11. data/Envfile +0 -3
  12. data/Guardfile +44 -0
  13. data/LICENSE +1 -1
  14. data/Makefile +24 -10
  15. data/README.md +22 -24
  16. data/Rakefile +13 -66
  17. data/gemfiles/rails_5.2.gemfile +3 -5
  18. data/immoscout.gemspec +45 -44
  19. data/lib/immoscout/api/client.rb +1 -0
  20. data/lib/immoscout/api/connection.rb +8 -9
  21. data/lib/immoscout/api/request.rb +3 -2
  22. data/lib/immoscout/configuration.rb +12 -6
  23. data/lib/immoscout/errors/failed.rb +1 -0
  24. data/lib/immoscout/models/actions/attachment.rb +2 -3
  25. data/lib/immoscout/models/actions/contact.rb +3 -14
  26. data/lib/immoscout/models/actions/publish.rb +1 -3
  27. data/lib/immoscout/models/actions/real_estate.rb +4 -14
  28. data/lib/immoscout/models/apartment_buy.rb +3 -0
  29. data/lib/immoscout/models/base.rb +2 -1
  30. data/lib/immoscout/models/concerns/modelable.rb +2 -0
  31. data/lib/immoscout/models/concerns/propertiable.rb +4 -1
  32. data/lib/immoscout/models/concerns/renderable.rb +5 -5
  33. data/lib/immoscout/models/contact.rb +2 -0
  34. data/lib/immoscout/models/document.rb +2 -0
  35. data/lib/immoscout/models/house_buy.rb +3 -0
  36. data/lib/immoscout/models/parts/address.rb +3 -0
  37. data/lib/immoscout/models/parts/api_search_data.rb +3 -0
  38. data/lib/immoscout/models/parts/contact.rb +3 -0
  39. data/lib/immoscout/models/parts/coordinate.rb +3 -0
  40. data/lib/immoscout/models/parts/courtage.rb +3 -0
  41. data/lib/immoscout/models/parts/energy_certificate.rb +3 -0
  42. data/lib/immoscout/models/parts/energy_source.rb +3 -0
  43. data/lib/immoscout/models/parts/firing_type.rb +3 -0
  44. data/lib/immoscout/models/parts/geo_code.rb +3 -0
  45. data/lib/immoscout/models/parts/geo_hierarchy.rb +3 -0
  46. data/lib/immoscout/models/parts/international_country_region.rb +3 -0
  47. data/lib/immoscout/models/parts/price.rb +3 -0
  48. data/lib/immoscout/models/parts/publish_channel.rb +3 -0
  49. data/lib/immoscout/models/parts/real_estate.rb +3 -0
  50. data/lib/immoscout/models/parts/url.rb +3 -0
  51. data/lib/immoscout/models/parts/urls.rb +3 -0
  52. data/lib/immoscout/models/picture.rb +2 -0
  53. data/lib/immoscout/models/publish.rb +2 -0
  54. data/lib/immoscout/models.rb +0 -1
  55. data/lib/immoscout/version.rb +19 -1
  56. data/lib/immoscout.rb +1 -0
  57. metadata +101 -80
  58. data/gemfiles/rails_6.0.gemfile +0 -9
data/immoscout.gemspec CHANGED
@@ -5,55 +5,56 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'immoscout/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'immoscout'
9
- spec.version = Immoscout::VERSION
10
- spec.authors = ['Marcus Geissler']
11
- spec.email = ['marcus.geissler@hanseventures.com']
12
-
13
- spec.summary = 'Ruby client for the Immobilienscout24 REST API'
14
- spec.homepage = 'https://github.com/hausgold/immoscout'
15
- spec.license = 'MIT'
16
-
17
- spec.required_ruby_version = '~> 2.5'
18
-
19
- # Prevent pushing this gem to RubyGems.org.
20
- # To allow pushes either set the 'allowed_push_host'
21
- # to allow pushing to a single host or delete this
22
- # section to allow pushing to any host.
23
- if spec.respond_to?(:metadata)
24
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
25
- else
26
- raise 'RubyGems 2.0 or newer is required to protect against ' \
27
- 'public gem pushes.'
28
- end
8
+ spec.name = 'immoscout'
9
+ spec.version = Immoscout::VERSION
10
+ spec.authors = ['Marcus Geissler']
11
+ spec.email = ['marcus3006@gmail.com']
12
+
13
+ spec.license = 'MIT'
14
+ spec.summary = 'Ruby client for the Immobilienscout24 REST API'
15
+
16
+ base_uri = "https://github.com/hausgold/#{spec.name}"
17
+ spec.metadata = {
18
+ 'homepage_uri' => base_uri,
19
+ 'source_code_uri' => base_uri,
20
+ 'changelog_uri' => "#{base_uri}/blob/master/CHANGELOG.md",
21
+ 'bug_tracker_uri' => "#{base_uri}/issues",
22
+ 'documentation_uri' => "https://www.rubydoc.info/gems/#{spec.name}"
23
+ }
29
24
 
30
25
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
31
26
  f.match(%r{^(test|spec|features)/})
32
27
  end
33
- spec.bindir = 'exe'
34
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+
29
+ spec.bindir = 'exe'
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
31
  spec.require_paths = ['lib']
36
- spec.add_dependency 'activesupport', '>= 5.2.0'
37
- spec.add_dependency 'faraday', '~> 1.0'
38
- spec.add_dependency 'faraday_middleware', '~> 1.0'
32
+
33
+ spec.required_ruby_version = '>= 2.5'
34
+
35
+ spec.add_dependency 'activesupport', '>= 5.2'
36
+ spec.add_dependency 'faraday', '~> 1.10'
37
+ spec.add_dependency 'faraday_middleware', '~> 1.2'
39
38
  spec.add_dependency 'simple_oauth', '>= 0.3'
40
39
 
41
- spec.add_development_dependency 'appraisal'
42
- spec.add_development_dependency 'bundler', '>= 1.16', '< 3'
43
- spec.add_development_dependency 'factory_bot', '~> 4.11'
44
- spec.add_development_dependency 'railties', '>= 4.2.0', '< 6.1'
45
- spec.add_development_dependency 'rake', '~> 10.0'
46
- spec.add_development_dependency 'rdoc', '~> 6.1'
47
- spec.add_development_dependency 'redcarpet', '~> 3.4'
48
- spec.add_development_dependency 'rspec', '~> 3.0'
49
- spec.add_development_dependency 'rspec-json_expectations', '~> 1.4'
50
- spec.add_development_dependency 'rubocop', '~> 0.63.1'
51
- spec.add_development_dependency 'rubocop-rspec', '~> 1.31'
52
- spec.add_development_dependency 'simplecov', '< 0.18'
53
- spec.add_development_dependency 'terminal-table', '~> 1.8'
54
- spec.add_development_dependency 'timecop', '~> 0.9.1'
55
- spec.add_development_dependency 'vcr', '~> 3.0'
56
- spec.add_development_dependency 'webmock', '~> 3.5'
57
- spec.add_development_dependency 'yard', '~> 0.9.18'
58
- spec.add_development_dependency 'yard-activesupport-concern', '~> 0.0.1'
40
+ spec.add_development_dependency 'appraisal', '~> 2.4'
41
+ spec.add_development_dependency 'bundler', '~> 2.3'
42
+ spec.add_development_dependency 'countless', '~> 1.1'
43
+ spec.add_development_dependency 'factory_bot', '~> 6.2'
44
+ spec.add_development_dependency 'guard-rspec', '~> 4.7'
45
+ spec.add_development_dependency 'railties', '>= 5.2'
46
+ spec.add_development_dependency 'rake', '~> 13.0'
47
+ spec.add_development_dependency 'redcarpet', '~> 3.5'
48
+ spec.add_development_dependency 'rspec', '~> 3.12'
49
+ spec.add_development_dependency 'rspec-json_expectations', '~> 2.2'
50
+ spec.add_development_dependency 'rubocop', '~> 1.28'
51
+ spec.add_development_dependency 'rubocop-rails', '~> 2.14'
52
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.10'
53
+ spec.add_development_dependency 'simplecov', '>= 0.22'
54
+ spec.add_development_dependency 'terminal-table', '~> 3.0'
55
+ spec.add_development_dependency 'timecop', '>= 0.9.6'
56
+ spec.add_development_dependency 'vcr', '~> 6.0'
57
+ spec.add_development_dependency 'webmock', '~> 3.18'
58
+ spec.add_development_dependency 'yard', '>= 0.9.28'
59
+ spec.add_development_dependency 'yard-activesupport-concern', '>= 0.0.1'
59
60
  end
@@ -6,6 +6,7 @@ require_relative 'request'
6
6
 
7
7
  module Immoscout
8
8
  module Api
9
+ # The immoscout API client object.
9
10
  class Client
10
11
  include Singleton
11
12
  include Immoscout::Api::Connection
@@ -5,22 +5,21 @@ require 'faraday_middleware'
5
5
 
6
6
  module Immoscout
7
7
  module Api
8
+ # A connection builder/handler for reusable connections.
8
9
  module Connection
9
- # :reek:FeatureEnvy
10
10
  def connection
11
11
  @connection ||= Faraday::Connection.new(url: url) do |builder|
12
12
  configure_oauth(builder)
13
- builder.request :multipart
14
- builder.request :url_encoded
15
- builder.request :json
16
- builder.response :follow_redirects
17
- builder.response :json, content_type: /\bjson$/
18
- builder.adapter :net_http
13
+ builder.request :multipart
14
+ builder.request :url_encoded
15
+ builder.request :json
16
+ builder.response :follow_redirects
17
+ builder.response :json, content_type: /\bjson$/
18
+ builder.adapter :net_http
19
19
  end
20
- @connection
21
20
  end
22
21
 
23
- private
22
+ protected
24
23
 
25
24
  def configure_oauth(builder)
26
25
  builder.request(
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Immoscout
4
4
  module Api
5
+ # An abstract HTTP/API request.
5
6
  module Request
6
7
  def get(path, payload = nil, multipart = nil)
7
8
  request(:get, path, payload, multipart)
@@ -25,12 +26,12 @@ module Immoscout
25
26
  if multipart
26
27
  request.headers['Content-Type'] = 'multipart/form-data'
27
28
  else
28
- request.body = payload if payload
29
+ request.body = payload if payload
29
30
  request.headers['Content-Type'] = 'application/json;charset=UTF-8'
30
31
  end
31
32
  request.headers['Accept'] = 'application/json'
32
33
  request.headers['User-Agent'] = \
33
- "HausgoldImmoscout/#{Immoscout::VERSION}"
34
+ "RubyImmoscout/#{Immoscout::VERSION}"
34
35
  end
35
36
  end
36
37
  # rubocop:enable Metrics/MethodLength
@@ -1,13 +1,19 @@
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
 
@@ -17,11 +23,11 @@ module Immoscout
17
23
 
18
24
  config_accessor(:api_url_live) do
19
25
  'https://rest.immobilienscout24.de/' \
20
- "restapi/api/offer/#{api_version}"
26
+ "restapi/api/offer/#{api_version}"
21
27
  end
22
28
  config_accessor(:api_url_sandbox) do
23
29
  'https://rest.sandbox-immobilienscout24.de/' \
24
- "restapi/api/offer/#{api_version}"
30
+ "restapi/api/offer/#{api_version}"
25
31
  end
26
32
  end
27
33
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Immoscout
4
4
  module Errors
5
+ # Representation of a failed API request/response.
5
6
  class Failed < StandardError
6
7
  def initialize(response)
7
8
  @status = response.status
@@ -8,6 +8,7 @@ require_relative '../concerns/modelable'
8
8
  module Immoscout
9
9
  module Models
10
10
  module Actions
11
+ # Actions to work with attachments.
11
12
  module Attachment
12
13
  extend ActiveSupport::Concern
13
14
 
@@ -54,7 +55,7 @@ module Immoscout
54
55
  self
55
56
  end
56
57
 
57
- private
58
+ protected
58
59
 
59
60
  def file_extension
60
61
  File.extname(file_name)
@@ -80,7 +81,6 @@ module Immoscout
80
81
  }.fetch(ext)
81
82
  end
82
83
 
83
- # rubocop:disable Metrics/AbcSize because of the mapping logic
84
84
  def all(real_estate_id)
85
85
  response = api.get(
86
86
  "user/#{api.user_name}/realestate/#{real_estate_id}/attachment"
@@ -91,7 +91,6 @@ module Immoscout
91
91
  .map { |object| new(object) }
92
92
  .select { |object| object.type =~ /#{name.demodulize}/i }
93
93
  end
94
- # rubocop:enable Metrics/AbcSize
95
94
  end
96
95
  end
97
96
  end
@@ -3,11 +3,10 @@
3
3
  require 'json'
4
4
  require_relative '../concerns/modelable'
5
5
 
6
- # rubocop:disable Metrics/BlockLength because this is how an ActiveSupport
7
- # concern looks like
8
6
  module Immoscout
9
7
  module Models
10
8
  module Actions
9
+ # Actions to work with contacts.
11
10
  module Contact
12
11
  extend ActiveSupport::Concern
13
12
 
@@ -20,8 +19,6 @@ module Immoscout
20
19
  .fetch('realtorContactDetails', nil)
21
20
  end
22
21
 
23
- # rubocop:disable Metrics/AbcSize because this is the
24
- # bare minimum logic
25
22
  def save
26
23
  response = \
27
24
  if id
@@ -34,7 +31,6 @@ module Immoscout
34
31
  self.id = id_from_response(response) unless id
35
32
  self
36
33
  end
37
- # rubocop:enable Metrics/AbcSize
38
34
 
39
35
  def destroy
40
36
  response = api.delete("user/#{api.user_name}/contact/#{id}")
@@ -61,14 +57,8 @@ module Immoscout
61
57
  objects = unpack_collection.call(response.body)
62
58
  objects.map { |object| new(object) }
63
59
  end
64
-
65
- def first
66
- all.first
67
- end
68
-
69
- def last
70
- all.last
71
- end
60
+ delegate :first, to: :all
61
+ delegate :last, to: :all
72
62
 
73
63
  def create(hash)
74
64
  instance = new(hash)
@@ -80,4 +70,3 @@ module Immoscout
80
70
  end
81
71
  end
82
72
  end
83
- # rubocop:enable Metrics/BlockLength
@@ -6,6 +6,7 @@ require_relative '../concerns/modelable'
6
6
  module Immoscout
7
7
  module Models
8
8
  module Actions
9
+ # Actions to publish a Real Estate.
9
10
  module Publish
10
11
  extend ActiveSupport::Concern
11
12
 
@@ -26,9 +27,6 @@ module Immoscout
26
27
  self
27
28
  end
28
29
  end
29
-
30
- class_methods do
31
- end
32
30
  end
33
31
  end
34
32
  end
@@ -8,6 +8,7 @@ require_relative '../concerns/modelable'
8
8
  module Immoscout
9
9
  module Models
10
10
  module Actions
11
+ # Actions to work with real estate objects.
11
12
  module RealEstate
12
13
  extend ActiveSupport::Concern
13
14
 
@@ -21,8 +22,6 @@ module Immoscout
21
22
  .fetch('realEstateElement', nil)
22
23
  end
23
24
 
24
- # rubocop:disable Metrics/AbcSize because this is the
25
- # bare minimum logic
26
25
  def save
27
26
  response = \
28
27
  if id
@@ -35,7 +34,6 @@ module Immoscout
35
34
  self.id = id_from_response(response) unless id
36
35
  self
37
36
  end
38
- # rubocop:enable Metrics/AbcSize
39
37
 
40
38
  def destroy
41
39
  response = api.delete("user/#{api.user_name}/realestate/#{id}")
@@ -79,7 +77,7 @@ module Immoscout
79
77
  self
80
78
  end
81
79
 
82
- private
80
+ protected
83
81
 
84
82
  def check_placement_type(type)
85
83
  raise ArgumentError, "Unknown placement type '#{type}'" unless %w[
@@ -100,7 +98,6 @@ module Immoscout
100
98
  find("ext-#{external_id}")
101
99
  end
102
100
 
103
- # rubocop:disable Metrics/AbcSize because of the mapping logic
104
101
  def all
105
102
  response = api.get("user/#{api.user_name}/realestate")
106
103
  handle_response(response)
@@ -109,15 +106,8 @@ module Immoscout
109
106
  .map { |object| new(object) }
110
107
  .select { |object| object.type =~ /#{name.demodulize}/i }
111
108
  end
112
- # rubocop:enable Metrics/AbcSize
113
-
114
- def first
115
- all.first
116
- end
117
-
118
- def last
119
- all.last
120
- end
109
+ delegate :first, to: :all
110
+ delegate :last, to: :all
121
111
 
122
112
  def create(hash)
123
113
  instance = new(hash)
@@ -12,6 +12,9 @@ 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
@@ -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
@@ -5,6 +5,8 @@ require 'json'
5
5
  module Immoscout
6
6
  module Models
7
7
  module Concerns
8
+ # Provides base functionality to reference/map/(de)serialize
9
+ # models against the immoscout API.
8
10
  module Modelable
9
11
  extend ActiveSupport::Concern
10
12
 
@@ -3,6 +3,8 @@
3
3
  module Immoscout
4
4
  module Models
5
5
  module Concerns
6
+ # Includes functionality to access and modify
7
+ # model attributes transparently.
6
8
  module Propertiable
7
9
  extend ActiveSupport::Concern
8
10
 
@@ -14,7 +16,7 @@ module Immoscout
14
16
  # :reek:ControlParameter - standard stuff, reek!
15
17
  # :reek:TooManyStatements
16
18
  def method_missing(method_name, *arguments, &block)
17
- if method_name =~ /build\_(\w+)/
19
+ if method_name =~ /build_(\w+)/
18
20
  match = Regexp.last_match(1).intern
19
21
  properties = self.class.properties
20
22
  coerce_klass = properties.fetch(match).fetch(:coerce, nil)
@@ -39,6 +41,7 @@ module Immoscout
39
41
  class_methods do
40
42
  def property(name, **opts)
41
43
  attr_accessor(name)
44
+
42
45
  alias_name = opts.fetch(:alias, false)
43
46
  if alias_name
44
47
  alias_method alias_name, name
@@ -7,6 +7,7 @@ require 'json'
7
7
  module Immoscout
8
8
  module Models
9
9
  module Concerns
10
+ # Includes functionality to serialize a Ruby model properly.
10
11
  module Renderable
11
12
  extend ActiveSupport::Concern
12
13
 
@@ -15,12 +16,12 @@ module Immoscout
15
16
  wrapped? ? to_json_wrapped : to_json_unwrapped
16
17
  end
17
18
 
18
- def to_json
19
+ def to_json(*)
19
20
  as_json.to_json
20
21
  end
21
22
  alias_method :to_s, :to_json
22
23
 
23
- private
24
+ protected
24
25
 
25
26
  def wrapped?
26
27
  self.class.try(:json_wrapper)
@@ -30,6 +31,7 @@ module Immoscout
30
31
  # bare minimum logic
31
32
  # rubocop:disable Metrics/MethodLength dito
32
33
  # rubocop:disable Metrics/CyclomaticComplexity dito
34
+ # rubocop:disable Metrics/AbcSize dito
33
35
  def to_h
34
36
  self.class.properties.each_with_object({}) do |(key, value), memo|
35
37
  # skip if it's readonly and should not be exposed in #as_json
@@ -54,6 +56,7 @@ module Immoscout
54
56
  # rubocop:enable Metrics/PerceivedComplexity
55
57
  # rubocop:enable Metrics/MethodLength
56
58
  # rubocop:enable Metrics/CyclomaticComplexity
59
+ # rubocop:enable Metrics/AbcSize
57
60
 
58
61
  def to_json_wrapped
59
62
  { self.class.try(:json_wrapper) => to_json_unwrapped }
@@ -66,9 +69,6 @@ module Immoscout
66
69
  .deep_transform_keys { |key| key.camelize :lower }
67
70
  end
68
71
  end
69
-
70
- class_methods do
71
- end
72
72
  end
73
73
  end
74
74
  end
@@ -7,6 +7,8 @@ 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
@@ -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
@@ -14,6 +14,9 @@ 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
@@ -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