Class: Monban::UseCase::Auth::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/monban/use_case/auth/account.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



37
38
39
# File 'lib/monban/use_case/auth/account.rb', line 37

def [](key)
  [key]
end

#idObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/monban/use_case/auth/account.rb', line 22

def id
  @id ||= begin
    Getto::Params.new.validate() do |v|
      v.hash(
        public_id: v.combine([v.string, v.not_empty]){|val| param_error!(public_id: val) },
      )
    end or param_error!(account: )

    repository.(
      public_id: [:public_id],
      now:       time.now,
    ) or error.invalid_account! "public_id: #{account[:public_id]}"
  end
end