Sha256: 325c956a958164ae5557ee9565eb4a76e89074f6b339607045c56232af84a7f4

Contents?: true

Size: 855 Bytes

Versions: 5

Compression:

Stored size: 855 Bytes

Contents

class ModsDisplay::Cartographics < ModsDisplay::Field

  def fields
    return nil if @value.nil?
    return_values = []
    @value.each do |val|
      if val.respond_to?(:cartographics)
        val.cartographics.each do |field|
          scale = field.scale.empty? ? "Scale not given" : field.scale.text
          projection = field.projection.empty? ? nil : field.projection.text
          coordinates = field.coordinates.empty? ? nil : field.coordinates.text
          post_scale = [projection, coordinates].compact.length > 0 ? [projection, coordinates].compact.join(" ") : nil
          return_values << ModsDisplay::Values.new({:label => (displayLabel(field) || label || "Map data"),
                                                    :values => [[scale, post_scale].compact.join(" ; ")]})
        end
      end
    end
    return_values
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mods_display-0.0.5 lib/mods_display/fields/cartographics.rb
mods_display-0.0.4 lib/mods_display/fields/cartographics.rb
mods_display-0.0.3 lib/mods_display/fields/cartographics.rb
mods_display-0.0.2 lib/mods_display/fields/cartographics.rb
mods_display-0.0.1 lib/mods_display/fields/cartographics.rb