module Datarobot::AiApi::Refreshable
Public Instance Methods
refresh()
click to toggle source
# File lib/datarobot/ai_api/refreshable.rb, line 12 def refresh raise "cannot refresh #{self.class} - no method `find'" unless self.class.respond_to? :find raise "cannot refresh #{self.class} - object does not have an id" unless @id self.class.find(@id) end
Also aliased as: reload
refresh!()
click to toggle source
This was initially written to closely align with the other datarobot clients, but `reload` is much more activerecord-y
# File lib/datarobot/ai_api/refreshable.rb, line 3 def refresh! raise "cannot refresh #{self.class} - no method `find'" unless self.class.respond_to? :find raise "cannot refresh #{self.class} - no method `set_from_options'" unless respond_to? :set_from_options raise "cannot refresh #{self.class} - object does not have an id" unless @id self.class.find(@id) do |data| set_from_options(data) end end
Also aliased as: reload!