Class: ONIX::CodeFromYamlWithMime

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

Instance Attribute Summary

Attributes inherited from Code

#code, #human

Attributes included from Attributes

#attributes

Instance Method Summary collapse

Methods inherited from CodeFromYaml

code_ident, code_identifier, hash, list

Methods inherited from Code

from_code, from_human, hash

Methods included from CodeMethods

#human, #onix, #parse

Methods inherited from Subset

parse, #parse, #tag_match, #unsupported

Methods included from Attributes

attribute_class, #parse_attributes, #serialized_attributes

Instance Method Details

#mimetypeString

main formats

Returns:

  • (String)


92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/onix/code.rb', line 92

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