Class: EgovUtils::AddressSchema

Inherits:
EngineSchema
  • Object
show all
Defined in:
app/schemas/egov_utils/address_schema.rb

Instance Method Summary collapse

Methods inherited from EngineSchema

engine_name, #engine_name

Instance Method Details

#attribute_for_column(col) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'app/schemas/egov_utils/address_schema.rb', line 4

def attribute_for_column(col)
  case col.name
  when 'district'
    EgovUtils::District.new
  when 'region'
    EgovUtils::Region.new
  else
    super
  end
end

#initialize_available_attributesObject



23
24
25
26
27
# File 'app/schemas/egov_utils/address_schema.rb', line 23

def initialize_available_attributes
  @available_attributes ||= []
  @available_attributes << EgovUtils::FullAddress.new(model, 'full_address', schema: self)
  super
end

#main_attribute_nameObject



15
16
17
# File 'app/schemas/egov_utils/address_schema.rb', line 15

def main_attribute_name
  'full_address'
end

#pathObject



19
20
21
# File 'app/schemas/egov_utils/address_schema.rb', line 19

def path
  'to_s'
end