lib/economic/proxies/debtor_entry_proxy.rb in rconomic-0.5.2 vs lib/economic/proxies/debtor_entry_proxy.rb in rconomic-0.6.0
- old
+ new
@@ -1,26 +1,22 @@
-require 'economic/proxies/entity_proxy'
+require "economic/proxies/entity_proxy"
module Economic
class DebtorEntryProxy < EntityProxy
def find_by_invoice_number(from, to = from)
- response = request('FindByInvoiceNumber', {
- 'from' => from,
- 'to' => to
- })
+ response = request("FindByInvoiceNumber", "from" => from,
+ "to" => to)
response[:debtor_entry_handle].map do |debtor_entry_handle|
# Kinda ugly, but we get an array instead of a hash when there's only one result. :)
Hash[*debtor_entry_handle.to_a.flatten][:serial_number].to_i
end
end
def match(*serial_numbers)
- response = request('MatchEntries', {
- :entries => {
- "DebtorEntryHandle" => serial_numbers.map { |serial_number|
- { "SerialNumber" => serial_number }
- }
+ request("MatchEntries", :entries => {
+ "DebtorEntryHandle" => serial_numbers.map { |serial_number|
+ {"SerialNumber" => serial_number}
}
})
end
end
end