immobilienscout 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 754ab014cfc8cdc8e6139bd24adcdba2aaa403a8f919496311cda524a1969d16
4
- data.tar.gz: f6df5d74e3da9c0f8ba0af924dc190e41dabdb0542573d62fb654c549da90de3
3
+ metadata.gz: 57f34d7a68110485b5a07d4b36e5232f1422199a80d592eefbdc10f326704627
4
+ data.tar.gz: 6d75ad272e6232fef423e911f6f11f7d85edd70f24cfe43ce7bad4a9e8ccae63
5
5
  SHA512:
6
- metadata.gz: 2418ce31bbf7ac90d3ec5e6fec45c22c8b61f01f7536bdd5505f47f22fe8359bf84b388550556334444f08b831d3c13335ad7f24cf34c8211f64f6452f29d934
7
- data.tar.gz: dee93e8fece5792fd2694fbf67eb5ea01a27121bb9b7a37dacc0cdb7f6aa63cdefeb3d4056e3ab1b70f754e4a9c3ea6ee0e3f226c3c7b9dffaa3242036f0b3fa
6
+ metadata.gz: cdd687dd9618b57efbeccb0b0dd943726d153127ed63e4cea78564ece2f21589869fe6482d0f4215726fc0c054323d63b6c7e92a6c6dae3d0bcfbde48f729dbe
7
+ data.tar.gz: 321fb5718b7365d9429d4a100397b8314503bd8ef43b3d1b666d1876f3ddc2e3471c75683080aad4c163932adf9777ed3652ca2cbe8c65b5484b6d4b25b5b75f
data/CHANGELOG.md CHANGED
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.0.5] - 2020-02-06
10
+ Adding show endpoint to retrieve a single property
11
+
9
12
  ## [0.0.4] - 2019-10-17
10
13
  Adding endpoint to update order of attachments for a specific property
11
14
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- immobilienscout (0.0.3)
4
+ immobilienscout (0.0.5)
5
5
  activesupport
6
6
  json
7
7
  multipart-post
@@ -9,7 +9,7 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (5.2.3)
12
+ activesupport (5.2.4.1)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
@@ -22,10 +22,10 @@ GEM
22
22
  safe_yaml (~> 1.0.0)
23
23
  diff-lcs (1.3)
24
24
  hashdiff (1.0.0)
25
- i18n (1.6.0)
25
+ i18n (1.8.2)
26
26
  concurrent-ruby (~> 1.0)
27
- json (2.2.0)
28
- minitest (5.11.3)
27
+ json (2.3.0)
28
+ minitest (5.14.0)
29
29
  multipart-post (2.1.1)
30
30
  public_suffix (3.1.1)
31
31
  rake (12.3.3)
@@ -45,7 +45,7 @@ GEM
45
45
  safe_yaml (1.0.5)
46
46
  thread_safe (0.3.6)
47
47
  timecop (0.8.1)
48
- tzinfo (1.2.5)
48
+ tzinfo (1.2.6)
49
49
  thread_safe (~> 0.1)
50
50
  vcr (5.0.0)
51
51
  webmock (3.6.2)
data/README.md CHANGED
@@ -37,6 +37,11 @@ Immobilienscout::API::Property.publish({params})
37
37
  Immobilienscout::API::Property.destroy(is24_id)
38
38
  ```
39
39
 
40
+ - Show property
41
+ ```ruby
42
+ Immobilienscout::API::Property.show(is24_id)
43
+ ```
44
+
40
45
  #### Attachment
41
46
  - Add attachments to property
42
47
  ```ruby
@@ -22,6 +22,14 @@ module Immobilienscout
22
22
  execute_delete_request(destroy_url)
23
23
  end
24
24
 
25
+ def show(is24_id)
26
+ raise ArgumentError unless is24_id.present?
27
+
28
+ show_url = show_url(is24_id)
29
+
30
+ execute_get_request(show_url)
31
+ end
32
+
25
33
  private
26
34
 
27
35
  def execute_post_request(url, params)
@@ -38,6 +46,13 @@ module Immobilienscout
38
46
  parsed_response
39
47
  end
40
48
 
49
+ def execute_get_request(url)
50
+ parsed_response = Immobilienscout::Request.new(url).get
51
+ raise Immobilienscout::Errors::InvalidRequest, parsed_response.messages.map(&:messages) unless parsed_response.success?
52
+
53
+ parsed_response
54
+ end
55
+
41
56
  def create_url
42
57
  "#{Immobilienscout::Client.api_url}/restapi/api/offer/v1.0/user/me/realestate"
43
58
  end
@@ -49,6 +64,10 @@ module Immobilienscout
49
64
  def destroy_url(is24_id)
50
65
  "#{Immobilienscout::Client.api_url}/restapi/api/offer/v1.0/user/me/realestate/#{is24_id}"
51
66
  end
67
+
68
+ def show_url(is24_id)
69
+ "#{Immobilienscout::Client.api_url}/restapi/api/offer/v1.0/user/me/realestate/#{is24_id}"
70
+ end
52
71
  end
53
72
  end
54
73
  end
@@ -3,7 +3,7 @@ require 'uri'
3
3
 
4
4
  module Immobilienscout
5
5
  class Request
6
- def initialize(url, params = nil)
6
+ def initialize(url, params = {})
7
7
  @url = url
8
8
  @params = params
9
9
 
@@ -1,3 +1,3 @@
1
1
  module Immobilienscout
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immobilienscout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Homeday GmbH
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-17 00:00:00.000000000 Z
11
+ date: 2020-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json