Sha256: 000287122c606c96e1fceb2252cf8f91de51d5e15b596c579bd46898df172277
Contents?: true
Size: 901 Bytes
Versions: 16
Compression:
Stored size: 901 Bytes
Contents
module SparkApi module Models class SharedListing < Base extend Finders self.element_name="sharedlistings" def ListingIds=(listing_ids) attributes["ListingIds"] = Array(listing_ids) end def ViewId=(id) attributes["ViewId"] = id end def ReportId=(id) attributes["ReportId"] = id end def save(arguments={}) begin return save!(arguments) rescue BadResourceRequest => e rescue NotFound => e # log and leave SparkApi.logger.error("Failed to save SharedListing #{self}: #{e.message}") end false end def save!(arguments={}) results = connection.post self.class.path, attributes, arguments result = results.first attributes['ResourceUri'] = result['ResourceUri'] true end end end end
Version data entries
16 entries across 16 versions & 1 rubygems