class NeverBounce::API::Response::SingleCheck

Public Instance Methods

address_info() click to toggle source
# File lib/never_bounce/api/response/single_check.rb, line 33
def address_info
  igetset(:address_info) do
    if body_hash.has_key?(k = "address_info")
      Response::AddressInfo.new(body_hash: body_hash.fetch(k))
    end
  end
end
address_info?() click to toggle source

true if {#address_info} is present.

# File lib/never_bounce/api/response/single_check.rb, line 42
def address_info?
  !address_info.nil?
end
credits_info() click to toggle source
# File lib/never_bounce/api/response/single_check.rb, line 46
def credits_info
  igetset(:credits_info) do
    if (body_hash.has_key?(k = "credits_info"))
      h = body_hash.fetch(k)
      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
end
credits_info?() click to toggle source

true if {#credits_info} is present.

# File lib/never_bounce/api/response/single_check.rb, line 64
def credits_info?
  !credits_info.nil?
end