Module: Datarobot::AiApi::Refreshable
- Included in:
- AI, Dataset, LearningSession, Task
- Defined in:
- lib/datarobot/ai_api/refreshable.rb
Instance Method Summary collapse
- #refresh ⇒ Object (also: #reload)
-
#refresh! ⇒ Object
(also: #reload!)
This was initially written to closely align with the other datarobot clients, but ‘reload` is much more activerecord-y.
Instance Method Details
#refresh ⇒ Object Also known as: reload
12 13 14 15 16 |
# 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 |
#refresh! ⇒ Object Also known as: reload!
This was initially written to closely align with the other datarobot clients, but ‘reload` is much more activerecord-y
3 4 5 6 7 8 9 10 |
# 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| (data) end end |