Class: Dibuk::Response::Sent

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

Constant Summary collapse

SUCCESS_HTTP_STATUSES =
[200].freeze
SUCCESS_STATUSES =
[
    'OK'
].freeze
WRONG_EMAIL_CODES =
[
    '2010', #email is not valid
    '2011', #email domain is not supported
].freeze
NOT_AVAILABLE_FORMAT_CODES =
[
    '2012', #format for this email is not available
    '2022', #PDF size is limited to 50MB
].freeze

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

#not_available_format?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/dibuk/response/sent.rb', line 22

def not_available_format?
  self.class::NOT_AVAILABLE_FORMAT_CODES.include?(status)
end

#wrong_email?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/dibuk/response/sent.rb', line 18

def wrong_email?
  self.class::WRONG_EMAIL_CODES.include?(status)
end