module OmnivoreIO::OmnivoreObject::InstanceMethods

Public Instance Methods

as_json(options={}) click to toggle source
# File lib/omnivore-io/api.rb, line 33
def as_json(options={})
  json = {}
  self.class._json_attributes.each do |attr|
    val = self.send attr
    json[attr] = val
  end
  json
end
merge!(object) click to toggle source
# File lib/omnivore-io/api.rb, line 42
def merge!(object)
  self.class._json_attributes.each do |attr|
    if object.respond_to?(attr)
      if val = object.send(attr)
        self.send "#{attr}=".to_sym, val
      end
    end
  end
end