Class: JustimmoClient::V1::RealtyCost

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

Instance Method Summary collapse

Methods included from Utils

#autoload_dir, #translate

Methods included from Logging

default_logger, #logger, rails_logger

Instance Method Details

#*(other) ⇒ Object



30
31
32
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 30

def *(other)
  amount * other
end

#+(other) ⇒ Object



34
35
36
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 34

def +(other)
  amount + ::Money.new(other)
end

#-(other) ⇒ Object



38
39
40
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 38

def -(other)
  amount - ::Money.new(other)
end

#/(other) ⇒ Object



26
27
28
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 26

def /(other)
  amount / other
end

#inspectObject



64
65
66
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 64

def inspect
  "#<#{self.class} #{self}>"
end

#to_fObject



50
51
52
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 50

def to_f
  amount.to_f
end

#to_hObject



54
55
56
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 54

def to_h
  { currency: currency.id, amount: amount.to_f }
end

#to_json(options = nil) ⇒ Object Also known as: as_json



58
59
60
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 58

def to_json(options = nil)
  to_h.to_json(options)
end

#to_sObject



46
47
48
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 46

def to_s
  amount.format
end

#zero?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/justimmo_client/api/v1/models/realty_cost.rb', line 42

def zero?
  amount.zero?
end