Class: Economic::AccountProxy

Inherits:
EntityProxy show all
Defined in:
lib/economic/proxies/account_proxy.rb

Instance Attribute Summary

Attributes inherited from EntityProxy

#owner

Instance Method Summary collapse

Methods inherited from EntityProxy

#all, #append, #build, entity_class, #entity_class, entity_class_name, #entity_class_name, #find, #get_data, #initialize, #session

Constructor Details

This class inherits a constructor from Economic::EntityProxy

Instance Method Details

#find_by_name(name) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/economic/proxies/account_proxy.rb', line 7

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