class Twobook::AccountQuery::NameQuery

Attributes

name[R]

Public Class Methods

new(name, account: nil) click to toggle source
# File lib/twobook/account_query.rb, line 159
def initialize(name, account: nil)
  @name = name
  @account = account
end

Public Instance Methods

construct_account() click to toggle source
# File lib/twobook/account_query.rb, line 164
def construct_account
  raise 'Could not construct an account from this name query: no data or category' if @account.nil?
  @account
end
on(accounts) click to toggle source
# File lib/twobook/account_query.rb, line 169
def on(accounts)
  accounts.select { |account| account.name == @name }
end