Sha256: 5508a39cf1ea8ba609631ffae0e09149564b1c33433953d85520c171a3e66d75
Contents?: true
Size: 626 Bytes
Versions: 1
Compression:
Stored size: 626 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 paths 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
auther-10.1.0 | app/models/auther/account.rb |