class Fog::Oracle::Collection
Attributes
response[RW]
It’s important to store the whole response, it contains e.g. important info about whether there is another page of data.
Public Instance Methods
all(options = {})
click to toggle source
Returns detailed list of records
# File lib/fog/oracle/models/collection.rb, line 36 def all(options = {}) raise Fog::Oracle::Errors::InterfaceNotImplemented.new('Method :all is not implemented') end
get(id)
click to toggle source
Gets record given record’s id
# File lib/fog/oracle/models/collection.rb, line 41 def get(id) raise Fog::Oracle::Errors::InterfaceNotImplemented.new('Method :get is not implemented') end
Also aliased as: find_by_id
id_value(id)
click to toggle source
# File lib/fog/oracle/models/collection.rb, line 10 def id_value(id) if id.is_a?(Hash) id["value"] else id end end
load_response(response)
click to toggle source
# File lib/fog/oracle/models/collection.rb, line 18 def load_response(response) objects = response.body clear && objects.each { |object| self << new(object) } self.response = response self end
new_from_response(response)
click to toggle source
# File lib/fog/oracle/models/collection.rb, line 26 def new_from_response(response) obj = new(response.body) obj.response = response obj end