Sha256: e622686c4fed8cdc7e7b9bdfd62fa01a669051f4d9015ec32c14da29d72f730b
Contents?: true
Size: 669 Bytes
Versions: 7
Compression:
Stored size: 669 Bytes
Contents
require 'date' require 'time' module FlexmlsApi module Models class OpenHouse < Base extend Subresource self.element_name = "openhouses" def initialize(attributes={}) # Transform the date strings unless attributes['Date'].nil? date = Date.parse(attributes['Date']) attributes['Date'] = date attributes['StartTime'] = Time.parse("#{date}T#{attributes['StartTime']}") unless attributes['StartTime'].nil? attributes['EndTime'] = Time.parse("#{date}T#{attributes['EndTime']}") unless attributes['EndTime'].nil? end super(attributes) end end end end
Version data entries
7 entries across 7 versions & 2 rubygems