Sha256: a25540937ac88484e2422705f2a0a683e708d7da229cc954a25d0f7e85eaf4f9

Contents?: true

Size: 732 Bytes

Versions: 125

Compression:

Stored size: 732 Bytes

Contents

# encoding: utf-8
module Mail
  module CommonField # :nodoc:

    def name=(value)
      @name = value
    end

    def name
      @name ||= nil
    end

    def value=(value)
      @length = nil
      @tree = nil
      @element = nil
      @value = value
    end

    def value
      @value
    end

    def to_s
      decoded
    end

    def default
      decoded
    end

    def field_length
      @length ||= "#{name}: #{encode(decoded)}".length
    end

    def responsible_for?( val )
      name.to_s.downcase == val.to_s.downcase
    end

    private

    def strip_field(field_name, value)
      if value.is_a?(Array)
        value
      else
        value.to_s.gsub(/#{field_name}:\s+/i, '')
      end
    end

  end
end

Version data entries

125 entries across 114 versions & 12 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
classiccms-0.7.4 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
classiccms-0.7.3 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
classiccms-0.7.2 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
classiccms-0.7.1 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
classiccms-0.7.0 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
mail-2.2.20 lib/mail/fields/common/common_field.rb
challah-1.0.0.beta vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
challah-0.9.1.beta.3 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
devise_sociable-0.1.0 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb
challah-0.9.1.beta vendor/bundle/gems/mail-2.4.4/lib/mail/fields/common/common_field.rb