Class: Fiona7::AttributeReaders::DateAsDate

Inherits:
AttributeReader show all
Defined in:
lib/fiona7/attribute_readers/date_as_date.rb

Instance Method Summary collapse

Methods inherited from AttributeReader

#initialize

Constructor Details

This class inherits a constructor from Fiona7::AttributeReaders::AttributeReader

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
14
# File 'lib/fiona7/attribute_readers/date_as_date.rb', line 6

def call
  # NOTE: this is a bug in fiona connector 
  # [valid_(from|until)] returns a raw string
  if ["valid_from", "valid_until"].include?(self.attr_name.to_s)
    self.obj[self.attr_name]
  else
    self.obj[self.attr_name].try(:utc).try(:to_iso)
  end
end