Sha256: b5f3f0df6006e7e5ea95088796ae312200ea215140de96c4d70878cabd3fad9f

Contents?: true

Size: 671 Bytes

Versions: 9

Compression:

Stored size: 671 Bytes

Contents

require 'date'
require 'time'

module FlexmlsApi
  module Models
    class TourOfHome < Base
      extend Subresource

      self.element_name = "tourofhomes"
      
      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

9 entries across 9 versions & 2 rubygems

Version Path
spark_api-1.0.2 lib/spark_api/models/tour_of_home.rb~
spark_api-1.0.1 lib/spark_api/models/tour_of_home.rb~
spark_api-1.0.0 lib/spark_api/models/tour_of_home.rb~
flexmls_api-0.7.3 lib/flexmls_api/models/tour_of_home.rb
flexmls_api-0.7.5 lib/flexmls_api/models/tour_of_home.rb
flexmls_api-0.7.0 lib/flexmls_api/models/tour_of_home.rb
flexmls_api-0.6.5 lib/flexmls_api/models/tour_of_home.rb
flexmls_api-0.6.4 lib/flexmls_api/models/tour_of_home.rb
flexmls_api-0.4.5 lib/flexmls_api/models/tour_of_home.rb