Class TMail::ContentTypeHeader
In: lib/tmail/header.rb
Parent: StructuredHeader

Methods

[]   []=   content_type   main_type   main_type=   params   sub_type   sub_type=  

Constants

PARSE_TYPE = :CTYPE

Public Instance methods

[Source]

# File lib/tmail/header.rb, line 786
    def []( key )
      ensure_parsed
      @params and unquote(@params[key])
    end

[Source]

# File lib/tmail/header.rb, line 791
    def []=( key, val )
      ensure_parsed
      (@params ||= {})[key] = val
    end

[Source]

# File lib/tmail/header.rb, line 771
    def content_type
      ensure_parsed
      @sub ? sprintf('%s/%s', @main, @sub) : @main
    end

[Source]

# File lib/tmail/header.rb, line 751
    def main_type
      ensure_parsed
      @main
    end

[Source]

# File lib/tmail/header.rb, line 756
    def main_type=( arg )
      ensure_parsed
      @main = arg.downcase
    end

[Source]

# File lib/tmail/header.rb, line 776
    def params
      ensure_parsed
      unless @params.blank?
        @params.each do |k, v|
          @params[k] = unquote(v)
        end
      end
      @params
    end

[Source]

# File lib/tmail/header.rb, line 761
    def sub_type
      ensure_parsed
      @sub
    end

[Source]

# File lib/tmail/header.rb, line 766
    def sub_type=( arg )
      ensure_parsed
      @sub = arg.downcase
    end

[Validate]