Module: Immobilienscout24::Api::RealEstate
- Included in:
- Immobilienscout24::Api
- Defined in:
- lib/immobilienscout24/api/real_estate.rb
Overview
Methods for the RealEstate API
Per default the client will use the current user (‘me`). If you want to use an other user then you have to provide the id in the options hash.
Instance Method Summary collapse
-
#create_real_estate(estate, options = {}) ⇒ Hashie::Mash
Create a real estate.
-
#delete_real_estate(id, options = {}) ⇒ Hashie::Mash
Delete a real estate.
-
#real_estate(id, options = {}) ⇒ Hashie::Mash
Get a single real estate.
-
#real_estate_endpoint(resource, options = {}) ⇒ String
Generates the real estate endpoint.
-
#real_estates(params = {}, options = {}) ⇒ Hashie::Mash
Get a list of all real estates.
-
#update_real_estate(id, estate, options = {}) ⇒ Hashie::Mash
Update a real estate.
- #user_real_estate_endpoint(user, resource, options = {}) ⇒ Object
Instance Method Details
#create_real_estate(estate, options = {}) ⇒ Hashie::Mash
Create a real estate
47 48 49 |
# File 'lib/immobilienscout24/api/real_estate.rb', line 47 def create_real_estate(estate, = {}) post real_estate_endpoint("/realestate", ), estate end |
#delete_real_estate(id, options = {}) ⇒ Hashie::Mash
Delete a real estate
72 73 74 |
# File 'lib/immobilienscout24/api/real_estate.rb', line 72 def delete_real_estate(id, = {}) delete real_estate_endpoint("/realestate/#{id}", ) end |
#real_estate(id, options = {}) ⇒ Hashie::Mash
Get a single real estate
35 36 37 |
# File 'lib/immobilienscout24/api/real_estate.rb', line 35 def real_estate(id, = {}) get real_estate_endpoint("/realestate/#{id}", ) end |
#real_estate_endpoint(resource, options = {}) ⇒ String
Generates the real estate endpoint
83 84 85 86 |
# File 'lib/immobilienscout24/api/real_estate.rb', line 83 def real_estate_endpoint(resource, = {}) = {user: "me"}.merge() user_real_estate_endpoint(.fetch(:user), resource, ) end |
#real_estates(params = {}, options = {}) ⇒ Hashie::Mash
Get a list of all real estates
23 24 25 |
# File 'lib/immobilienscout24/api/real_estate.rb', line 23 def real_estates(params = {}, = {}) get real_estate_endpoint("/realestate", ), params end |
#update_real_estate(id, estate, options = {}) ⇒ Hashie::Mash
Update a real estate
60 61 62 |
# File 'lib/immobilienscout24/api/real_estate.rb', line 60 def update_real_estate(id, estate, = {}) put real_estate_endpoint("/realestate/#{id}", ), estate end |
#user_real_estate_endpoint(user, resource, options = {}) ⇒ Object
88 89 90 |
# File 'lib/immobilienscout24/api/real_estate.rb', line 88 def user_real_estate_endpoint(user, resource, = {}) [user_endpoint("/user/#{user}"), resource].join end |