class Dibuk::Response::Linked

Constants

SUCCESS_HTTP_STATUSES
SUCCESS_STATUSES

Public Instance Methods

all() click to toggle source
# File lib/dibuk/response/linked.rb, line 43
def all
  @formats || parse_formats
end
epub() click to toggle source
# File lib/dibuk/response/linked.rb, line 47
def epub
  get_format "epub"
end

Private Instance Methods

get_format(format) click to toggle source

@param [String] format @return [String] download url

# File lib/dibuk/response/linked.rb, line 65
def get_format(format)
  parse_formats
  @formats[format]
end
parse_formats() click to toggle source
# File lib/dibuk/response/linked.rb, line 53
def parse_formats
  @formats || begin
                @formats = {}
                body[:data].each do |num, url|
                  @formats[@@formats[num][:code]] = url
                end
                @formats
              end
end