Sha256: 08b6856f1df11914b5edb554fce02cb8643b7326617fe81b91d315b0e0679581
Contents?: true
Size: 655 Bytes
Versions: 27
Compression:
Stored size: 655 Bytes
Contents
# frozen_string_literal: true require "active_model" module Auther ACCOUNT_ATTRIBUTES = %i[ name encrypted_login encrypted_password paths authorized_url deauthorized_url ].freeze # Represents an authenticatable account. Account = Struct.new(*ACCOUNT_ATTRIBUTES, keyword_init: true) do include ActiveModel::Validations validates :name, :encrypted_login, :encrypted_password, presence: true validate :paths_type def initialize *arguments super self[:paths] ||= [] end private def paths_type errors.add :paths, "must be an array" unless paths.is_a? Array end end end
Version data entries
27 entries across 27 versions & 1 rubygems