Class: Economic::EntryProxy

Inherits:
EntityProxy show all
Defined in:
lib/economic/proxies/entry_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, #get_data, #initialize, #session

Constructor Details

This class inherits a constructor from Economic::EntityProxy

Instance Method Details

#find(serial_number) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/economic/proxies/entry_proxy.rb', line 31

def find(serial_number)
  response = request("GetData", "entityHandle" => {
    "SerialNumber" => serial_number
  })

  build(response)
end

#find_by_date_interval(from_date, to_date) ⇒ Object



7
8
9
10
11
12
# File 'lib/economic/proxies/entry_proxy.rb', line 7

def find_by_date_interval(from_date, to_date)
  response = request("FindByDateInterval", "fromDate" => from_date,
                                           "toDate" => to_date)

  build_array(response)
end

#find_by_serial_number_interval(min_number, max_number) ⇒ Object

Undocumented tip: if you only care about the min_number, pass in the maximum possible value as max_number so you don’t have to call ‘get_last_used_serial_number`:

max_number = 2**31 - 1  # Maximum int32.


19
20
21
22
23
24
# File 'lib/economic/proxies/entry_proxy.rb', line 19

def find_by_serial_number_interval(min_number, max_number)
  response = request("FindBySerialNumberInterval", "minNumber" => min_number,
                                                   "maxNumber" => max_number)

  build_array(response)
end

#get_last_used_serial_numberObject



26
27
28
29
# File 'lib/economic/proxies/entry_proxy.rb', line 26

def get_last_used_serial_number
  response = request("GetLastUsedSerialNumber")
  response.to_i
end