nepalez/abbyy-cloud

View on GitHub
lib/abbyy/cloud/models/payment_type.rb

Summary

Maintainability
A
15 mins
Test Coverage
class ABBYY::Cloud
  module Models
    class PaymentType < ::String
      VALUES = %w(Manual Balance External).freeze

      def self.new(string)
        super Types::Strict::String.constrained(included_in: VALUES)[string]
      end
    end

    # Registers type Types::PaymentType
    Types.register_type PaymentType
  end
end