Class: ConnectStoopid::TimeEntry
- Inherits:
-
Object
- Object
- ConnectStoopid::TimeEntry
- Defined in:
- lib/connect-stoopid/time-entry.rb
Instance Method Summary collapse
-
#add_time_entry(options = { "MemberID" => "testuser", "ChargeCode" => "Automated (testuser)", "WorkType" => "Regular", "DateStart" => "", "TimeStart" => "", "TimeEnd" => "", "Notes" => "", }) ⇒ Object
Error on failure, returns true on addition of time entry.
-
#initialize(psa_address, company, username, password, options = {}) ⇒ TimeEntry
constructor
A new instance of TimeEntry.
Constructor Details
#initialize(psa_address, company, username, password, options = {}) ⇒ TimeEntry
Returns a new instance of TimeEntry.
9 10 11 12 |
# File 'lib/connect-stoopid/time-entry.rb', line 9 def initialize(psa_address, company, username, password, = {}) ConnectStoopid.wsdl = "https://#{psa_address}/v4_6_release/apis/1.5/TimeEntryApi.asmx?wsdl" ConnectStoopid.connect(company, username, password, ) end |
Instance Method Details
#add_time_entry(options = { "MemberID" => "testuser", "ChargeCode" => "Automated (testuser)", "WorkType" => "Regular", "DateStart" => "", "TimeStart" => "", "TimeEnd" => "", "Notes" => "", }) ⇒ Object
Error on failure, returns true on addition of time entry.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/connect-stoopid/time-entry.rb', line 20 def add_time_entry( = { "MemberID" => "testuser", "ChargeCode" => "Automated (testuser)", "WorkType" => "Regular", "DateStart" => "", "TimeStart" => "", "TimeEnd" => "", "Notes" => "", } ) ConnectStoopid.("Adding a Time Entry | Member: #{['MemberID']} Start: #{['TimeStart']} End: #{['TimeEnd']}", :debug) = ConnectStoopid.base_soap_hash .merge!({ "timeEntry" => }) begin response = ConnectStoopid.soap_client.call(:add_time_entry, :message => ) rescue Savon::SOAPFault => error ConnectStoopid.("SOAP Fault\nError Message:\n#{error}", :error) else if response.success? result = true else result = false end end return result end |