Class: JustimmoClient::V1::RealtyPrice

Inherits:
JustimmoBase show all
Defined in:
lib/justimmo_client/api/v1/models/realty_price.rb

Attributes collapse

Instance Method Summary collapse

Methods included from Utils

#autoload_dir, #translate

Methods included from Logging

default_logger, #logger, rails_logger

Instance Method Details

#additionalObject

TODO: add more additional costs



65
66
67
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 65

def additional
  [operating_cost].map(&:to_f).sum
end

#commissionString

Returns:

  • (String)


15
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 15

attribute :commission,             String

#currencySymbol

Returns:

  • (Symbol)


9
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 9

attribute :currency,               Symbol, default: :EUR

#depositRealtyCost

Returns:



29
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 29

attribute :deposit,                RealtyCost

#getObject



69
70
71
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 69

def get
  @purcase || @rent
end

#including_vatBoolean

Returns:

  • (Boolean)


11
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 11

attribute :including_vat,          Boolean

#land_registryFloat

Returns:

  • (Float)


14
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 14

attribute :land_registry,          Float

#on_demandBoolean

Returns:

  • (Boolean)


12
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 12

attribute :on_demand,              Boolean

#on_demand?Boolean

Returns:

  • (Boolean)


49
50
51
52
53
54
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 49

def on_demand?
  return on_demand if on_demand
  return purcase.zero? if purcase
  return rent.zero? if rent
  true
end

#operating_costRealtyCost

Returns:



26
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 26

attribute :operating_cost,         RealtyCost

#operating_cost_netRealtyCost

Returns:



27
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 27

attribute :operating_cost_net,     RealtyCost

#operating_cost_per_sqmRealtyCost

Returns:



28
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 28

attribute :operating_cost_per_sqm, RealtyCost

#operating_cost_vatInteger

Returns:

  • (Integer)


17
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 17

attribute :operating_cost_vat,     Integer

#provisionBoolean

Returns:

  • (Boolean)


10
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 10

attribute :provision,              Boolean

#purcaseRealtyCost

Returns:



18
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 18

attribute :purcase,                RealtyCost

#purcase?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 60

def purcase?
  !purcase.nil?
end

#purcase_netRealtyCost

Returns:



19
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 19

attribute :purcase_net,            RealtyCost

#real_estate_taxesFloat

Returns:

  • (Float)


13
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 13

attribute :real_estate_taxes,      Float

#rentRealtyCost

Returns:



20
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 20

attribute :rent,                   RealtyCost

#rent?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 56

def rent?
  !rent.nil?
end

#rent_coldRealtyCost

Returns:



22
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 22

attribute :rent_cold,              RealtyCost

#rent_cold_netRealtyCost

Returns:



23
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 23

attribute :rent_cold_net,          RealtyCost

#rent_including_heatingRealtyCost

Returns:



24
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 24

attribute :rent_including_heating, RealtyCost

#rent_netRealtyCost

Returns:



21
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 21

attribute :rent_net,               RealtyCost

#rent_per_sqmRealtyCost

Returns:



25
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 25

attribute :rent_per_sqm,           RealtyCost

#rent_vatInteger

Returns:

  • (Integer)


16
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 16

attribute :rent_vat,               Integer

#to_fObject



73
74
75
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 73

def to_f
  get.to_f
end

#to_sObject



77
78
79
# File 'lib/justimmo_client/api/v1/models/realty_price.rb', line 77

def to_s
  on_demand? ? translate("price.on_demand") : get.to_s
end