Sha256: 6f5c6478f4ab19bb83f1662c6903693f526db8cc47983f3a9534def8adc2530f

Contents?: true

Size: 736 Bytes

Versions: 16

Compression:

Stored size: 736 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
require 'mail/fields/named_structured_field'
require 'mail/utilities'

module Mail
  class MimeVersionField < NamedStructuredField #:nodoc:
    NAME = 'Mime-Version'

    def self.singular?
      true
    end

    def initialize(value = nil, charset = nil)
      value = '1.0' if Utilities.blank?(value)
      super value, charset
    end

    def element
      @element ||= Mail::MimeVersionElement.new(value)
    end

    def version
      "#{element.major}.#{element.minor}"
    end

    def major
      element.major.to_i
    end

    def minor
      element.minor.to_i
    end

    def encoded
      "#{name}: #{version}\r\n"
    end

    def decoded
      version
    end
  end
end

Version data entries

16 entries across 15 versions & 6 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/mail-2.8.1/lib/mail/fields/mime_version_field.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/mime_version_field.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/fields/mime_version_field.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/fields/mime_version_field.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/mime_version_field.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/mime_version_field.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/mime_version_field.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/mime_version_field.rb
mail-2.8.1 lib/mail/fields/mime_version_field.rb
mail-2.8.1.rc2 lib/mail/fields/mime_version_field.rb
mail-2.8.0.1 lib/mail/fields/mime_version_field.rb
mail-2.8.0.1.rc1 lib/mail/fields/mime_version_field.rb
mail-2.8.0 lib/mail/fields/mime_version_field.rb
mail-2.8.0.rc3 lib/mail/fields/mime_version_field.rb
mail-2.8.0.rc2 lib/mail/fields/mime_version_field.rb
mail-2.8.0.rc1 lib/mail/fields/mime_version_field.rb