immoscout 1.3.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/documentation.yml +3 -2
- data/.github/workflows/release.yml +47 -0
- data/.github/workflows/test.yml +6 -5
- data/.rspec +2 -1
- data/.rubocop.yml +23 -4
- data/.simplecov +12 -0
- data/Appraisals +1 -5
- data/CHANGELOG.md +16 -0
- data/Dockerfile +2 -3
- data/Envfile +0 -3
- data/Guardfile +44 -0
- data/LICENSE +1 -1
- data/Makefile +24 -10
- data/README.md +22 -24
- data/Rakefile +13 -66
- data/gemfiles/rails_5.2.gemfile +3 -5
- data/immoscout.gemspec +45 -44
- data/lib/immoscout/api/client.rb +1 -0
- data/lib/immoscout/api/connection.rb +8 -9
- data/lib/immoscout/api/request.rb +3 -2
- data/lib/immoscout/configuration.rb +12 -6
- data/lib/immoscout/errors/failed.rb +1 -0
- data/lib/immoscout/models/actions/attachment.rb +2 -3
- data/lib/immoscout/models/actions/contact.rb +3 -14
- data/lib/immoscout/models/actions/publish.rb +1 -3
- data/lib/immoscout/models/actions/real_estate.rb +4 -14
- data/lib/immoscout/models/apartment_buy.rb +3 -0
- data/lib/immoscout/models/base.rb +2 -1
- data/lib/immoscout/models/concerns/modelable.rb +2 -0
- data/lib/immoscout/models/concerns/propertiable.rb +4 -1
- data/lib/immoscout/models/concerns/renderable.rb +5 -5
- data/lib/immoscout/models/contact.rb +2 -0
- data/lib/immoscout/models/document.rb +2 -0
- data/lib/immoscout/models/house_buy.rb +3 -0
- data/lib/immoscout/models/parts/address.rb +3 -0
- data/lib/immoscout/models/parts/api_search_data.rb +3 -0
- data/lib/immoscout/models/parts/contact.rb +3 -0
- data/lib/immoscout/models/parts/coordinate.rb +3 -0
- data/lib/immoscout/models/parts/courtage.rb +3 -0
- data/lib/immoscout/models/parts/energy_certificate.rb +3 -0
- data/lib/immoscout/models/parts/energy_source.rb +3 -0
- data/lib/immoscout/models/parts/firing_type.rb +3 -0
- data/lib/immoscout/models/parts/geo_code.rb +3 -0
- data/lib/immoscout/models/parts/geo_hierarchy.rb +3 -0
- data/lib/immoscout/models/parts/international_country_region.rb +3 -0
- data/lib/immoscout/models/parts/price.rb +3 -0
- data/lib/immoscout/models/parts/publish_channel.rb +3 -0
- data/lib/immoscout/models/parts/real_estate.rb +3 -0
- data/lib/immoscout/models/parts/url.rb +3 -0
- data/lib/immoscout/models/parts/urls.rb +3 -0
- data/lib/immoscout/models/picture.rb +2 -0
- data/lib/immoscout/models/publish.rb +2 -0
- data/lib/immoscout/models.rb +0 -1
- data/lib/immoscout/version.rb +19 -1
- data/lib/immoscout.rb +1 -0
- metadata +101 -80
- 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
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
12
|
-
|
13
|
-
spec.
|
14
|
-
spec.
|
15
|
-
|
16
|
-
|
17
|
-
spec.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
34
|
-
spec.
|
28
|
+
|
29
|
+
spec.bindir = 'exe'
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
31
|
spec.require_paths = ['lib']
|
36
|
-
|
37
|
-
spec.
|
38
|
-
|
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', '
|
43
|
-
spec.add_development_dependency '
|
44
|
-
spec.add_development_dependency '
|
45
|
-
spec.add_development_dependency '
|
46
|
-
spec.add_development_dependency '
|
47
|
-
spec.add_development_dependency '
|
48
|
-
spec.add_development_dependency '
|
49
|
-
spec.add_development_dependency 'rspec
|
50
|
-
spec.add_development_dependency '
|
51
|
-
spec.add_development_dependency 'rubocop
|
52
|
-
spec.add_development_dependency '
|
53
|
-
spec.add_development_dependency '
|
54
|
-
spec.add_development_dependency '
|
55
|
-
spec.add_development_dependency '
|
56
|
-
spec.add_development_dependency '
|
57
|
-
spec.add_development_dependency '
|
58
|
-
spec.add_development_dependency '
|
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
|
data/lib/immoscout/api/client.rb
CHANGED
@@ -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
|
14
|
-
builder.request
|
15
|
-
builder.request
|
16
|
-
builder.response
|
17
|
-
builder.response
|
18
|
-
builder.adapter
|
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
|
-
|
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
|
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
|
-
"
|
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(:
|
10
|
-
config_accessor(:
|
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
|
-
|
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
|
-
|
30
|
+
"restapi/api/offer/#{api_version}"
|
25
31
|
end
|
26
32
|
end
|
27
33
|
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 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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
@@ -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 =~ /
|
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
|
-
|
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
|
@@ -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
|