Class: Justimmo::API::RealtyCategory

Inherits:
Resource
  • Object
show all
Defined in:
lib/justimmo/api/v1/realty/realty_category.rb

Overview

Holds category information.

Instance Method Summary collapse

Methods inherited from Resource

class_name, from_json, mapper, query, #to_h, #to_json

Constructor Details

#initialize(options = {}) ⇒ RealtyCategory


10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/justimmo/api/v1/realty/realty_category.rb', line 10

def initialize(options = {})
  @attributes = i[
    usage marketing_type
    user_defined_simplefield user_defined_anyfield
  ]

  # remove duplicate information
  options.delete(:realty_type)

  super(options)

  update_attributes(:usage)
  update_attributes(:marketing_type)
end

Instance Method Details

#sub_type_idObject


29
30
31
# File 'lib/justimmo/api/v1/realty/realty_category.rb', line 29

def sub_type_id
  @attributes[:user_defined_simplefield][2][:value]
end

#type_idObject


25
26
27
# File 'lib/justimmo/api/v1/realty/realty_category.rb', line 25

def type_id
  @attributes[:user_defined_simplefield].first[:value]
end