justimmo_client 0.6.0 → 0.6.1
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.
- checksums.yaml +4 -4
- data/bin/console +2 -0
- data/lib/justimmo_client/api/v1/interfaces/realty_interface.rb +4 -4
- data/lib/justimmo_client/api/v1/models/realty_type.rb +8 -0
- data/lib/justimmo_client/core/utils.rb +3 -1
- data/lib/justimmo_client/version.rb +1 -1
- data/locales/de.yml +15 -0
- data/locales/en.yml +1 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28c8c5889fc30bf130af4e4f14fe53c147d7252c
|
4
|
+
data.tar.gz: 269cdbff8ecd55635a8fe62efdb6f47c6b31c909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48aaa4888d18ee373a7b51ea8825abc7dc552b8235f9b0b729bed68a515c28455022893e56c268c8849409394db2633fd379e31de39eaebea654ec29fe30e01d
|
7
|
+
data.tar.gz: 90e74ba04d557e458be70c10861ecbe15a0079a0ce72c5029d9f9e43aa9cb39693aeb2ab4f1fa6a21cc17df9462d9f95395e408adb8d4a81d845e1f6f6ca55d3
|
data/bin/console
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require "bundler/setup"
|
4
4
|
require "justimmo_client"
|
5
5
|
require "dotenv"
|
6
|
+
require "active_support"
|
6
7
|
|
7
8
|
Dotenv.load
|
8
9
|
|
@@ -10,6 +11,7 @@ JustimmoClient.configure do |config|
|
|
10
11
|
config.username = ENV['JUSTIMMO_USERNAME']
|
11
12
|
config.password = ENV['JUSTIMMO_PASSWORD']
|
12
13
|
config.debug = ENV['DEBUG']
|
14
|
+
config.cache = ActiveSupport::Cache.lookup_store(:memory_store) if ENV['DEV_CACHING']
|
13
15
|
end
|
14
16
|
|
15
17
|
begin
|
@@ -67,7 +67,7 @@ module JustimmoClient::V1
|
|
67
67
|
model = Struct.new(:realties).new
|
68
68
|
xml_response = request(:realty).list(options)
|
69
69
|
represented = representer(:realty_list).new(model).from_xml(xml_response).realties
|
70
|
-
new_cache = representer(:realty, :json).for_collection.new(
|
70
|
+
new_cache = representer(:realty, :json).for_collection.new(represented).to_json
|
71
71
|
[represented, new_cache]
|
72
72
|
end
|
73
73
|
rescue JustimmoClient::RetrievalFailed
|
@@ -78,15 +78,15 @@ module JustimmoClient::V1
|
|
78
78
|
# @param [Symbol, String] lang
|
79
79
|
# @return [Realty, nil] A detailed realty object, or nil if it could not be found.
|
80
80
|
def detail(id, lang: nil)
|
81
|
-
with_cache cache_key("realty/detail",
|
81
|
+
with_cache cache_key("realty/detail", lang: lang),
|
82
82
|
on_hit: ->(cached) do
|
83
|
-
representer(:realty, :json).new(model(:realty)).from_json(cached)
|
83
|
+
representer(:realty, :json).new(model(:realty).new).from_json(cached)
|
84
84
|
end,
|
85
85
|
on_miss: -> do
|
86
86
|
xml_response = request(:realty).detail(id, lang: lang)
|
87
87
|
model = Struct.new(:realty).new
|
88
88
|
represented = representer(:realty_detail).new(model).from_xml(xml_response).realty
|
89
|
-
new_cache = representer(:realty, :json).new(
|
89
|
+
new_cache = representer(:realty, :json).new(represented).to_json
|
90
90
|
[represented, new_cache]
|
91
91
|
end
|
92
92
|
rescue JustimmoClient::RetrievalFailed
|
data/locales/de.yml
CHANGED
@@ -5,3 +5,18 @@ de:
|
|
5
5
|
living: Wohnen
|
6
6
|
business: Gewerbe
|
7
7
|
investment: Anlage
|
8
|
+
|
9
|
+
types:
|
10
|
+
room: Zimmer
|
11
|
+
apartment: Wohnung
|
12
|
+
house: Haus
|
13
|
+
property: Grundstück
|
14
|
+
office: Büro / Praxis
|
15
|
+
retail: Einzelhandel
|
16
|
+
hospitality: Gastgewerbe
|
17
|
+
business: Industrie / Gewerbe
|
18
|
+
agriculture: Land und Forstwirtschaft
|
19
|
+
other: Sonstige / Sonderobjekte
|
20
|
+
recreational_property_business: Freizeitimmobilie gewerblich
|
21
|
+
yield: Zinshaus / Renditeobjekt
|
22
|
+
parking: Parken
|
data/locales/en.yml
CHANGED