module CHECKING::YOU::IN::INLANDGESPRÄCH

Constants

IETF_TREES

Non-IETF-tree as a CY(I|O)'s `kingdom` signifies the need for a leading `vnd.` facet when reconstructing the Media-Type String.

Public Instance Methods

inspect() click to toggle source

Pretty-print objects using our custom `#:to_s`

# File lib/checking-you-out/auslandsgesprach.rb, line 214
def inspect
  "#<#{self.class.to_s} #{self.to_s}>"
end
to_s() click to toggle source

Reconstruct an IETF Media-Type String from a loaded CYI/CYO's `#members`

# File lib/checking-you-out/auslandsgesprach.rb, line 199
def to_s
  # TODO: Fragments (e.g. `;what=ever`), and syntax identifiers (e.g. `+xml`)
  -(String.new(encoding: Encoding::UTF_8, capacity: 128) << self.phylum.to_s << -'/' << case
  when self.kingdom == -'kayo-dot' then -'x.'
  when self.kingdom == -?x then -'x-'
  when self.kingdom == -'x-ms' then -'x-ms-'
  when self.kingdom == -'prs' then -'prs.'
  when self.kingdom == -'vnd' then -'vnd.'
  when self.kingdom == -'possum' then nil.to_s
  when !IETF_TREES.include?(self.kingdom.to_s) then 'vnd.' << self.kingdom.to_s << -'.'
  else self.kingdom.to_s << -'.'
  end << self.genus.to_s)
end