module MITS::V3_0::Mapper::FilesMapper
Public Instance Methods
file(tag, entity = File)
click to toggle source
# File lib/mits/v3.0/mapper/files_mapper.rb, line 10 def file(tag, entity = File) entity.new(active: bool(tag[:Active]), caption: tag[:Caption], description: tag[:Description], format: tag[:Format], height: try(tag[:Height], :to_i), id: tag[:FileID], name: tag[:Name], rank: tag[:Rank], source: tag[:Src], type: tag[:FileType], width: tag[:Width]) end
files(tags, entity = File)
click to toggle source
# File lib/mits/v3.0/mapper/files_mapper.rb, line 5 def files(tags, entity = File) tags = [tags] unless tags.is_a? Array tags.map { |tag| file(tag, entity) } end