Sha256: c4c29c4b819809d1df62bf2b41b93da59e2ddb0f3a5645252f20120d5ea41df4

Contents?: true

Size: 782 Bytes

Versions: 236

Compression:

Stored size: 782 Bytes

Contents

# encoding: utf-8
# 
# 
# 
module Mail
  class ContentLocationField < StructuredField
    
    FIELD_NAME = 'content-location'
    CAPITALIZED_FIELD = 'Content-Location'
    
    def initialize(value = nil, charset = 'utf-8')
      self.charset = charset
      super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, value), charset)
      self.parse
      self
    end
    
    def parse(val = value)
      unless val.blank?
        @element = Mail::ContentLocationElement.new(val)
      end
    end
    
    def element
      @element ||= Mail::ContentLocationElement.new(value)
    end

    def location
      element.location
    end

    # TODO: Fix this up
    def encoded
      "#{CAPITALIZED_FIELD}: #{location}\r\n"
    end
    
    def decoded
      location 
    end

  end
end

Version data entries

236 entries across 193 versions & 23 rubygems

Version Path
mail-2.5.5 lib/mail/fields/content_location_field.rb
mail-2.5.5.rc1 lib/mail/fields/content_location_field.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
classiccms-0.7.5 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/content_location_field.rb
classiccms-0.7.4 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/content_location_field.rb
classiccms-0.7.3 vendor/bundle/gems/mail-2.4.4/lib/mail/fields/content_location_field.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/mail-2.6.3/lib/mail/fields/content_location_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/content_location_field.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/mail-2.6.3/lib/mail/fields/content_location_field.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/mail-2.4.4/lib/mail/fields/content_location_field.rb
mail-2.6.3 lib/mail/fields/content_location_field.rb
mail-portertech-2.6.2.edge lib/mail/fields/content_location_field.rb
mail-2.6.1 lib/mail/fields/content_location_field.rb