Class Simplepay::Support::Epoch
In: lib/simplepay/support/epoch.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 Simplepay::Support::Field :class delegator.

This class provides a means to have Time values returned as an integer since epoch (January 1, 1970).

Methods

new   to_s  

Public Class methods

[Source]

# File lib/simplepay/support/epoch.rb, line 12
      def initialize(time)
        @value = time ? parse(time) : Time.now
      end

Public Instance methods

Returns a String of Integers, representing seconds since epoch.

[Source]

# File lib/simplepay/support/epoch.rb, line 19
      def to_s
        @value.to_i.to_s
      end

[Validate]