Class: Economic::CashBookProxy

Inherits:
EntityProxy show all
Defined in:
lib/economic/proxies/cash_book_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
# File 'lib/economic/proxies/cash_book_proxy.rb', line 7

def find_by_name(name)
  response = request("FindByName", "name" => name)

  cash_book = build
  cash_book.partial = true
  cash_book.persisted = true
  cash_book.number = response[:number]
  cash_book
end

#get_name(id) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/economic/proxies/cash_book_proxy.rb', line 17

def get_name(id)
  response = request("GetName", "cashBookHandle" => {
    "Number" => id
  })

  cash_book = build
  cash_book.number = id
  cash_book.name = response
  cash_book
end