class NeverBounce::API::Response::AccountInfo

Public Instance Methods

credits_info() click to toggle source

@return [CreditsInfo::Monthly] @return [CreditsInfo::Paid]

# File lib/never_bounce/api/response/account_info.rb, line 19
def credits_info
  @credits_info ||= begin
    h = body_hash.fetch("credits_info")
    klass = if h.has_key? "monthly_api_usage"
      CreditsInfo::Monthly
    elsif h.has_key? "paid_credits_remaining"
      CreditsInfo::Paid
    else
      raise "Unknown `credits_info`: #{h.inspect}"
    end

    klass.new(h)
  end
end
job_counts() click to toggle source

@return [JobCounts]

# File lib/never_bounce/api/response/account_info.rb, line 35
def job_counts
  @job_counts ||= JobCounts.new(body_hash: body_hash.fetch("job_counts"))
end