Module: JustimmoClient

Extended by:
API, Logging, Utils
Includes:
Errors
Defined in:
lib/justimmo_client.rb,
lib/justimmo_client/misc.rb,
lib/justimmo_client/api/v1.rb,
lib/justimmo_client/version.rb,
lib/justimmo_client/autoload.rb,
lib/justimmo_client/interface.rb,
lib/justimmo_client/core/utils.rb,
lib/justimmo_client/core/config.rb,
lib/justimmo_client/core/caching.rb,
lib/justimmo_client/core/logging.rb,
lib/justimmo_client/option_parser.rb,
lib/justimmo_client/core/api_helpers.rb

Overview

The Justimmo API.

Defined Under Namespace

Modules: API, Caching, Errors, Logging, Utils, V1 Classes: Config, OptionParser

Constant Summary collapse

VERSION =
"0.6.9"

Constants included from Errors

Errors::ConfigurationError, Errors::JustimmoError

Realty collapse

Employee collapse

Basic Data collapse

Class Method Summary collapse

Methods included from Logging

default_logger, logger, rails_logger

Methods included from Utils

autoload_dir, translate

Methods included from API

api, interface, model, representer, request, versioned_api

Class Method Details

.cities(**options) ⇒ Array<City>

Get a list of cities and their zip codes.

Returns:

  • (Array<City>)

See Also:



96
97
98
# File 'lib/justimmo_client/interface.rb', line 96

def cities(**options)
  interface(:realty).zip_codes_and_cities(options)
end

.configure(&block) ⇒ Object

Loads configuration and initializes the API.



11
12
13
14
# File 'lib/justimmo_client.rb', line 11

def configure(&block)
  JustimmoClient::Config.configure(&block)
  initialize_api
end

.countries(**options) ⇒ Array<Country>

Get a list of countries.

Returns:

  • (Array<Country>)

See Also:



75
76
77
# File 'lib/justimmo_client/interface.rb', line 75

def countries(**options)
  interface(:realty).countries(options)
end

.employee(id) ⇒ Employee

Retrieve detailed information about a single employee.

Returns:

  • (Employee)


46
47
48
# File 'lib/justimmo_client/interface.rb', line 46

def employee(id)
  interface(:employee).detail(id)
end

.employee_idsArray<Integer>

Get a list of all employee IDs.

Returns:

  • (Array<Integer>)


52
53
54
# File 'lib/justimmo_client/interface.rb', line 52

def employee_ids
  interface(:employee).ids
end

.employeesArray<Employee>

Retrieve a list of employee data.

Returns:

  • (Array<Employee>)


39
40
41
# File 'lib/justimmo_client/interface.rb', line 39

def employees
  interface(:employee).list
end

.federal_states(**options) ⇒ Array<FederalState>

Get a list of federal states.

Returns:

  • (Array<FederalState>)

See Also:



82
83
84
# File 'lib/justimmo_client/interface.rb', line 82

def federal_states(**options)
  interface(:realty).federal_states(options)
end

.initialize_apiObject



16
17
18
19
# File 'lib/justimmo_client.rb', line 16

def initialize_api
  api_ver = JustimmoClient::Config.api_ver
  send :autoload, "V#{api_ver}", "justimmo_client/api/v#{api_ver}"
end

.realties(**options) ⇒ Array<Realty>

Get a list of realty objects with limited information.

Examples:

Filter by zip code and limit to three results.

JustimmoClient.realties(zip_code: 6800, limit: 3)

Options Hash (**options):

  • :limit (Integer) — default: 10
  • :offset (Integer) — default: 0
  • :lang (Symbol, String) — default: :de
  • :orderby (Symbol, String)
  • :ordertype (Symbol, String) — default: :asc
  • :picturesize (Symbol, String) — default: :small
  • :with_projects (Boolean) — default: false
  • :price_min (Float)
  • :price_max (Float)
  • :price_per_sqm_min (Float)
  • :price_per_sqm_max (Float)
  • :type_id (Integer)
  • :type (Symbol, String, Array<Symbol, String>)
  • :sub_type_id (Integer)
  • :tag (Symbol, String)
  • :zip_code (String, Integer)
  • :zip_code_min (String, Integer)
  • :zip_code_max (String, Integer)
  • :rooms_min (Integer)
  • :rooms_max (Integer)
  • :number (Integer)
  • :number_min (Integer)
  • :number_max (Integer)
  • :area_min (Float)
  • :area_max (Float)
  • :living_area_min (Float)
  • :living_area_max (Float)
  • :floor_area_min (Float)
  • :floor_area_max (Float)
  • :surface_area_min (Float)
  • :surface_area_max (Float)
  • :keyword (Symbol, String)
  • :country_id (Integer)
  • :federal_state_id (Integer)
  • :status_id (Integer)
  • :rent (Boolean)
  • :purcase (Boolean)
  • :owner_id (Integer)
  • :project_id (Integer)
  • :system_type (String)
  • :parent_id (Integer)
  • :updated_at_min (DateTime)
  • :updated_at_max (DateTime)
  • :location (String)

Returns:

  • (Array<Realty>)

    An array of basic realty objects, or an empty array on error.

See Also:



15
16
17
# File 'lib/justimmo_client/interface.rb', line 15

def realties(**options)
  interface(:realty).list(options)
end

.realty(id, lang: nil) ⇒ Realty?

Get detailed information about a single realty.

Parameters:

  • id (Integer)
  • lang (Symbol, String) (defaults to: nil)

Returns:

  • (Realty, nil)

    A detailed realty object, or nil if it could not be found.

See Also:



23
24
25
# File 'lib/justimmo_client/interface.rb', line 23

def realty(id, lang: nil)
  interface(:realty).detail(id, lang: lang)
end

.realty_categories(**options) ⇒ Array<RealtyCategory>

Get a list of available categories.

Returns:

  • (Array<RealtyCategory>)

See Also:



61
62
63
# File 'lib/justimmo_client/interface.rb', line 61

def realty_categories(**options)
  interface(:realty).categories(options)
end

.realty_ids(options = {}) ⇒ Array<Integer>

Get a list of all realty ids.

Options Hash (options):

  • :limit (Integer) — default: 10
  • :offset (Integer) — default: 0
  • :lang (Symbol, String) — default: :de
  • :orderby (Symbol, String)
  • :ordertype (Symbol, String) — default: :asc
  • :picturesize (Symbol, String) — default: :small
  • :with_projects (Boolean) — default: false
  • :price_min (Float)
  • :price_max (Float)
  • :price_per_sqm_min (Float)
  • :price_per_sqm_max (Float)
  • :type_id (Integer)
  • :type (Symbol, String, Array<Symbol, String>)
  • :sub_type_id (Integer)
  • :tag (Symbol, String)
  • :zip_code (String, Integer)
  • :zip_code_min (String, Integer)
  • :zip_code_max (String, Integer)
  • :rooms_min (Integer)
  • :rooms_max (Integer)
  • :number (Integer)
  • :number_min (Integer)
  • :number_max (Integer)
  • :area_min (Float)
  • :area_max (Float)
  • :living_area_min (Float)
  • :living_area_max (Float)
  • :floor_area_min (Float)
  • :floor_area_max (Float)
  • :surface_area_min (Float)
  • :surface_area_max (Float)
  • :keyword (Symbol, String)
  • :country_id (Integer)
  • :federal_state_id (Integer)
  • :status_id (Integer)
  • :rent (Boolean)
  • :purcase (Boolean)
  • :owner_id (Integer)
  • :project_id (Integer)
  • :system_type (String)
  • :parent_id (Integer)
  • :updated_at_min (DateTime)
  • :updated_at_max (DateTime)
  • :location (String)

Returns:

  • (Array<Integer>)

    An array of realty ids, empty array if no results.

See Also:



31
32
33
# File 'lib/justimmo_client/interface.rb', line 31

def realty_ids(options = {})
  interface(:realty).ids(options)
end

.realty_types(**options) ⇒ Array<RealtyType>

Get a list of available realty types.

Returns:

  • (Array<RealtyType>)

See Also:



68
69
70
# File 'lib/justimmo_client/interface.rb', line 68

def realty_types(**options)
  interface(:realty).types(options)
end

.regions(**options) ⇒ Array<Region>

Get a list of regions.

Returns:

  • (Array<Region>)

See Also:



89
90
91
# File 'lib/justimmo_client/interface.rb', line 89

def regions(**options)
  interface(:realty).regions(options)
end