Class: NeverBounce::API::Response::CreditsInfo::Base

Inherits:
NeverBounce::API::Response::Container show all
Defined in:
lib/never_bounce/api/response/credits_info/base.rb

Direct Known Subclasses

Monthly, Paid

Instance Attribute Summary collapse

Attributes inherited from NeverBounce::API::Response::Container

#body_hash, #raw

Instance Method Summary collapse

Methods inherited from NeverBounce::API::Response::Container

oattr, scalar_oattr

Instance Attribute Details

#free_credits_remainingInteger

Returns:

  • (Integer)


8
# File 'lib/never_bounce/api/response/credits_info/base.rb', line 8

oattr :free_credits_remaining, :scalar, type: :integer

#free_credits_usedInteger

Returns:

  • (Integer)


12
# File 'lib/never_bounce/api/response/credits_info/base.rb', line 12

oattr :free_credits_used, :scalar, type: :integer

Instance Method Details

#monthly?Boolean

true if monthly subscription.

Returns:

  • (Boolean)


21
22
23
# File 'lib/never_bounce/api/response/credits_info/base.rb', line 21

def monthly?
  subscription_type == :monthly
end

#paid?Boolean

true if paid subscription.

Returns:

  • (Boolean)


26
27
28
# File 'lib/never_bounce/api/response/credits_info/base.rb', line 26

def paid?
  subscription_type == :paid
end

#subscription_typeSymbol

:monthly or :paid.

Returns:

  • (Symbol)

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/never_bounce/api/response/credits_info/base.rb', line 16

def subscription_type
  raise NotImplementedError, "Redefine `subscription_type` in final class: #{self.class}"
end