Sha256: 9784008b4c46cf28716b5579e3a51c65c091610b75d0e8333505a94688bf2451
Contents?: true
Size: 660 Bytes
Versions: 3
Compression:
Stored size: 660 Bytes
Contents
# frozen_string_literal: true require "active_model" module Auther module Presenter # Adapter for presenting an account within a view. class Account include ActiveModel::Validations attr_accessor :name, :login, :password validates :name, :login, :password, presence: true def initialize options = {} @name = options[:name] @login = options[:login] @password = options[:password] end def error? key errors.key? key end def error_message key return "" unless error?(key) "#{key.capitalize} #{errors.messages[key].first}" end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
auther-7.0.0 | app/presenters/auther/account.rb |
auther-6.1.0 | app/presenters/auther/account.rb |
auther-6.0.0 | app/presenters/auther/account.rb |