lokalebasen/rconomic

View on GitHub
lib/economic/proxies/account_proxy.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'economic/proxies/entity_proxy'

module Economic
  class AccountProxy < EntityProxy
    def find_by_name(name)
      response = request('FindByName', {
        'name' => name
      })

      handle = response[:account_handle]

      entity = build(response)
      entity.name = name
      entity.number = handle[:number]
      entity.persisted = true
      entity
    end
  end
end