Class Simplepay::Support::Boolean
In: lib/simplepay/support/boolean.rb
Parent: Object
RuntimeError Error Service Standard Marketplace Donation Subscription MarketplacePolicy Interval SubscriptionPeriod BillingFrequency Comparable Field Service Epoch Currency Amount Boolean ResponseStatusCode Services Authentication FormHelper NotificationHelper RailsHelper Helpers Interval Currency Support Boolean Simplepay dot/f_2.png

Acts as a delegator for Simplepay::Support::Field :class.

This class acts as a helper for sending boolean values to Amazon. In their forms, booleans are expected to be either "0" or "1", for false or true, respectively.

Methods

new   to_s  

Public Class methods

[Source]

# File lib/simplepay/support/boolean.rb, line 13
      def initialize(value)
        @value = value
      end

Public Instance methods

Returns "1" if the boolean is true, "0" otherwise.

[Source]

# File lib/simplepay/support/boolean.rb, line 20
      def to_s
        return '' if @value.nil?
        @value ? Simplepay::Boolean::True : Simplepay::Boolean::False
      end

[Validate]