Class: Economic::CashBook

Inherits:
Entity
  • Object
show all
Defined in:
lib/economic/cash_book.rb

Overview

Represents a cash book in E-conomic.

API documentation: www.e-conomic.com/apidocs/Documentation/T_Economic_Api_ICashBook.html

Instance Attribute Summary

Attributes inherited from Entity

#id, #number, #partial, #persisted, #session

Instance Method Summary collapse

Methods inherited from Entity

#==, default_values, defaults, #destroy, #get, #get_data, #handle=, handle_writer, has_properties, #initialize, #inspect, key, #partial?, #persisted?, properties, properties_not_triggering_full_load, property_reader, property_writer, proxy, #proxy, #save, #update_properties

Constructor Details

This class inherits a constructor from Economic::Entity

Instance Method Details

#bookObject

Books all entries in the cashbook. Returns book result.



21
22
23
24
# File 'lib/economic/cash_book.rb', line 21

def book
  response = request(:book, "cashBookHandle" => handle.to_hash)
  response[:number].to_i
end

#entriesObject



16
17
18
# File 'lib/economic/cash_book.rb', line 16

def entries
  CashBookEntryProxy.new(self)
end

#handleObject



12
13
14
# File 'lib/economic/cash_book.rb', line 12

def handle
  @handle || Handle.new(:number => @number)
end