Class: Dibuk::Response::Linked

Inherits:
Base
  • Object
show all
Defined in:
lib/dibuk/response/linked.rb

Constant Summary collapse

SUCCESS_HTTP_STATUSES =
[200].freeze
SUCCESS_STATUSES =
[
    'OK'
].freeze
@@formats =
{
    "3": {
        'title': 'EPUB',
        'code': 'epub',
        'mimetype': 'application/epub+zip'
    },
    "4": {
        'title': 'PDF',
        'code': 'pdf',
        'mimetype': 'application/pdf'
    },
    "5": {
        'title': 'MOBI',
        'code': 'mobi',
        'mimetype': 'application/x-mobipocket-ebook'
    },
    "1": {
        'title': 'EPUB (Adobe DRM)',
        'code': 'acs_epub',
        'mimetype': 'application/epub+zip'
    },
    "2": {
        'title': 'PDF (Adobe DRM)',
        'code': 'acs_pdf',
        'mimetype': 'application/pdf'
    },
    "6": {'title': 'EPUB', 'code': 'social_epub', 'mimetype': 'application/epub+zip'},
    "7": {'title': 'PDF', 'code': 'social_pdf', 'mimetype': 'application/pdf'},
    "8": {'title': 'MOBI', 'code': 'social_mobi', 'mimetype': 'application/x-mobipocket-ebook'},
    "9 ": {'title': 'MP3', 'code': 'mp3', 'mimetype': 'audio/mpeg'}
}

Instance Method Summary collapse

Methods inherited from Base

#body, #error?, #error_code, #error_data, #http_status_ok, #limit_exceeded?, #not_buyed?, #success?

Instance Method Details

#allObject



43
44
45
# File 'lib/dibuk/response/linked.rb', line 43

def all
  @formats || parse_formats
end

#epubObject



47
48
49
# File 'lib/dibuk/response/linked.rb', line 47

def epub
  get_format "epub"
end