Class: GandiV5::Billing::Info::Prepaid

Inherits:
Object
  • Object
show all
Includes:
Data
Defined in:
lib/gandi_v5/billing/info/prepaid.rb

Overview

Account’s prepaid information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Data

#from_gandi, included, #initialize, #to_gandi, #to_h, #values_at

Instance Attribute Details

#amountNumeric (readonly)

Returns current amount available in the prepaid account.

Returns:

  • (Numeric)

    current amount available in the prepaid account.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gandi_v5/billing/info/prepaid.rb', line 17

class Prepaid
  include GandiV5::Data

  members :amount, :currency, :warning_threshold
  member :created_at, converter: GandiV5::Data::Converter::Time
  member :updated_at, converter: GandiV5::Data::Converter::Time

  # Check if current balance is below the warning threshold.
  def warning?
    return nil if warning_threshold.nil?

    amount < warning_threshold
  end
end

#created_atTime (readonly)

Returns creation date of the prepaid account.

Returns:

  • (Time)

    creation date of the prepaid account.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gandi_v5/billing/info/prepaid.rb', line 17

class Prepaid
  include GandiV5::Data

  members :amount, :currency, :warning_threshold
  member :created_at, converter: GandiV5::Data::Converter::Time
  member :updated_at, converter: GandiV5::Data::Converter::Time

  # Check if current balance is below the warning threshold.
  def warning?
    return nil if warning_threshold.nil?

    amount < warning_threshold
  end
end

#currencyString (readonly)

Returns currency in use for the prepaid account.

Returns:

  • (String)

    currency in use for the prepaid account.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gandi_v5/billing/info/prepaid.rb', line 17

class Prepaid
  include GandiV5::Data

  members :amount, :currency, :warning_threshold
  member :created_at, converter: GandiV5::Data::Converter::Time
  member :updated_at, converter: GandiV5::Data::Converter::Time

  # Check if current balance is below the warning threshold.
  def warning?
    return nil if warning_threshold.nil?

    amount < warning_threshold
  end
end

#updated_atTime (readonly)

Returns last modification date of the prepaid account.

Returns:

  • (Time)

    last modification date of the prepaid account.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gandi_v5/billing/info/prepaid.rb', line 17

class Prepaid
  include GandiV5::Data

  members :amount, :currency, :warning_threshold
  member :created_at, converter: GandiV5::Data::Converter::Time
  member :updated_at, converter: GandiV5::Data::Converter::Time

  # Check if current balance is below the warning threshold.
  def warning?
    return nil if warning_threshold.nil?

    amount < warning_threshold
  end
end

#warning_thresholdNumeric (readonly)

Returns amount under which a warning email is sent.

Returns:

  • (Numeric)

    amount under which a warning email is sent.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gandi_v5/billing/info/prepaid.rb', line 17

class Prepaid
  include GandiV5::Data

  members :amount, :currency, :warning_threshold
  member :created_at, converter: GandiV5::Data::Converter::Time
  member :updated_at, converter: GandiV5::Data::Converter::Time

  # Check if current balance is below the warning threshold.
  def warning?
    return nil if warning_threshold.nil?

    amount < warning_threshold
  end
end

Instance Method Details

#warning?Boolean

Check if current balance is below the warning threshold.

Returns:

  • (Boolean)


25
26
27
28
29
# File 'lib/gandi_v5/billing/info/prepaid.rb', line 25

def warning?
  return nil if warning_threshold.nil?

  amount < warning_threshold
end