class XporterOnDemand::Result::Base

Public Class Methods

new(args = {}) click to toggle source
# File lib/xporter_on_demand/result/base.rb, line 6
def initialize(args = {})
  result = args.delete(:result)
  assign_attributes(result)
end

Public Instance Methods

type() click to toggle source
# File lib/xporter_on_demand/result/base.rb, line 11
def type
  self.class.name.demodulize
end
update(other_result) click to toggle source
# File lib/xporter_on_demand/result/base.rb, line 15
def update(other_result)
  return if other_result.type != type ||\
            other_result.id != id ||\
            other_result.last_updated <= last_updated

  attributes.each do |attribute|
    send("#{attribute}=", other_result.send(attribute))
  end
end