Sha256: 0819cd62d633aaba1f9a037f54d38b606ccebfec41b38bfd9dc578b31d8e9372

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

module Mollie
  class Terminal < Base

    STATUS_PENDING   = "pending".freeze
    STATUS_ACTIVE    = "active".freeze
    STATUS_INACTIVE  = "inactive".freeze

    attr_accessor :id,
                  :profile_id,
                  :status,
                  :brand,
                  :model,
                  :serial_number,
                  :currency,
                  :description,
                  :created_at,
                  :updated_at,
                  :deactivated_at,
                  :_links

    alias links _links

    def pending?
      status == STATUS_PENDING
    end

    def active?
      status == STATUS_ACTIVE
    end

    def inactive?
      status == STATUS_INACTIVE
    end

    def created_at=(created_at)
      @created_at = begin
                      Time.parse(created_at.to_s)
                    rescue StandardError
                      nil
                    end
    end

    def updated_at=(updated_at)
      @updated_at = begin
                      Time.parse(updated_at.to_s)
                    rescue StandardError
                      nil
                    end
    end

    def deactivated_at=(deactivated_at)
      @deactivated_at = begin
                          Time.parse(deactivated_at.to_s)
                        rescue StandardError
                          nil
                        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mollie-api-ruby-4.14.0 lib/mollie/terminal.rb