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

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) define_schema(&proc)



1206
1207
1208
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1206

def define_schema(&proc)
    @schema_define_proc = proc
end

- (Object) extended(obj)



1193
1194
1195
1196
1197
1198
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1193

def extended(obj)
    obj.define_schema &@schema_define_proc if @schema_define_proc
    obj.with_schema &@schema_proc if @schema_proc
    obj.no_map(*@no_map_elements.keys) if @no_map_elements
    @model_proc.call(obj.model) if @model_proc
end

- (Object) no_map(*els)



1200
1201
1202
1203
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1200

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

- (Object) with_model(&proc)



1214
1215
1216
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1214

def with_model(&proc)
    @model_proc = proc
end

- (Object) with_schema(&proc)



1210
1211
1212
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1210

def with_schema(&proc)
    @schema_proc = proc
end