Module: Crunchbase::DateMethods

Included in:
Company, FinancialOrganization, Investment, Person, Product
Defined in:
lib/crunchbase/date_methods.rb

Instance Method Summary collapse

Instance Method Details

#date_from_components(year, month, day) ⇒ Object

Constructs a Date object from year, month, day, returns nil if it fails



5
6
7
8
9
10
11
12
# File 'lib/crunchbase/date_methods.rb', line 5

def date_from_components(year, month, day)
  begin
    date = Date.new(year, month, day)
  rescue
    date = nil
  end
  date
end