Class: TMail::ContentTypeHeader

Inherits:
StructuredHeader show all
Defined in:
lib/tmail-pure/header.rb

Constant Summary collapse

PARSE_TYPE =
:CTYPE

Constants inherited from HeaderField

HeaderField::FNAME_TO_CLASS

Instance Method Summary collapse

Methods inherited from StructuredHeader

#comments

Methods inherited from HeaderField

#accept, #body, #body=, #empty?, #illegal?, #initialize, #inspect, internal_new, new, new_from_port, newobj

Methods included from StrategyInterface

#accept_strategy, create_dest, #decoded, #encoded

Constructor Details

This class inherits a constructor from TMail::HeaderField

Instance Method Details

#[](key) ⇒ Object



728
729
730
731
# File 'lib/tmail-pure/header.rb', line 728

def [](key)
  ensure_parsed
  @params and @params[key]
end

#[]=(key, val) ⇒ Object



733
734
735
736
# File 'lib/tmail-pure/header.rb', line 733

def []=(key, val)
  ensure_parsed
  (@params ||= {})[key] = val
end

#content_typeObject



718
719
720
721
# File 'lib/tmail-pure/header.rb', line 718

def content_type
  ensure_parsed
  @sub ? sprintf('%s/%s', @main, @sub) : @main
end

#main_typeObject



698
699
700
701
# File 'lib/tmail-pure/header.rb', line 698

def main_type
  ensure_parsed
  @main
end

#main_type=(arg) ⇒ Object



703
704
705
706
# File 'lib/tmail-pure/header.rb', line 703

def main_type=(arg)
  ensure_parsed
  @main = arg.downcase
end

#paramsObject



723
724
725
726
# File 'lib/tmail-pure/header.rb', line 723

def params
  ensure_parsed
  @params
end

#sub_typeObject



708
709
710
711
# File 'lib/tmail-pure/header.rb', line 708

def sub_type
  ensure_parsed
  @sub
end

#sub_type=(arg) ⇒ Object



713
714
715
716
# File 'lib/tmail-pure/header.rb', line 713

def sub_type=(arg)
  ensure_parsed
  @sub = arg.downcase
end