Class: ONIX::CodeFromYamlWithMime

Inherits:
CodeFromYaml show all
Defined in:
lib/onix/code.rb

Instance Attribute Summary

Attributes inherited from Code

#code, #human

Instance Method Summary collapse

Methods inherited from CodeFromYaml

code_ident, hash, list

Methods inherited from Code

from_code, from_human

Methods included from CodeHelper

#human, #onix, #parse

Methods inherited from Subset

parse, #parse, tag_match, #tag_match, #unsupported

Instance Method Details

#mimetypeObject

main formats



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/onix/code.rb', line 69

def mimetype
  case self.human
    when "Epub"
      "application/epub"
    when "Pdf"
      "application/pdf"
    when "Mobipocket"
      "application/x-mobipocket-ebook"
    when "Gif"
      "image/gif"
    when "Jpeg"
      "image/jpeg"
    when "Png"
      "image/png"
  end
end