Method: IntacctRB::Attachment#get_date_at

Defined in:
lib/intacctrb/attachment.rb

#get_date_at(xpath, object) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/intacctrb/attachment.rb', line 24

def get_date_at(xpath, object)
  year = object.at("#{xpath}/year").content
  month = object.at("#{xpath}/month").content
  day = object.at("#{xpath}/day").content
  if [year,month,day].any?(&:empty?)
    nil
  else
    Date.new(year.to_i,month.to_i,day.to_i)
  end
end