Module: Spider::Model::MapperIncludeModule::ModuleMethods

Defined in:
lib/spiderfw/model/mappers/mapper.rb

Instance Method Summary collapse

Instance Method Details

#define_schema(&proc) ⇒ Object



1184
1185
1186
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1184

def define_schema(&proc)
    @schema_define_proc = proc
end

#extended(obj) ⇒ Object



1173
1174
1175
1176
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1173

def extended(obj)
    obj.define_schema &@schema_define_proc if @schema_define_proc
    obj.with_schema &@schema_proc if @schema_proc
end

#no_map(*els) ⇒ Object



1178
1179
1180
1181
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1178

def no_map(*els)
    @no_map_elements ||= {}
    els.each{ |el| @no_map_elements[el] = true }
end

#with_schema(&proc) ⇒ Object



1188
1189
1190
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1188

def with_schema(&proc)
    @schema_proc = proc
end