Sha256: 9c7d61bb894e4cd7aa8ac0e3c7723f058b823cb6507f7730c3618164c633dd0e

Contents?: true

Size: 855 Bytes

Versions: 6

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

6 entries across 6 versions & 1 rubygems

Version Path
mods_display-0.0.1.beta6 lib/mods_display/fields/cartographics.rb
mods_display-0.0.1.beta5 lib/mods_display/fields/cartographics.rb
mods_display-0.0.1.beta4 lib/mods_display/fields/cartographics.rb
mods_display-0.0.1.beta3 lib/mods_display/fields/cartographics.rb
mods_display-0.0.1.beta2 lib/mods_display/fields/cartographics.rb
mods_display-0.0.1.beta1 lib/mods_display/fields/cartographics.rb