Sha256: c5f74390dc6636a0434fcc756b98ac2d3ba03d865324667b83db0cc784921629
Contents?: true
Size: 1.15 KB
Versions: 2
Compression:
Stored size: 1.15 KB
Contents
module SparkApi module Models class IdxLink < Base extend Finders self.element_name="idxlinks" LINK_TYPES = ["QuickSearch", "SavedSearch", "MyListings", "Roster"] #TODO Work all below into common base class def self.find(*arguments) scope = arguments.slice!(0) options = arguments.slice!(0) || {} case scope when :all then find_every(options) when :first then find_every(options).first when :last then find_every(options).last when :one then find_one(options) else find_single(scope, options) end end def self.first(*arguments) find(:first, *arguments) end def self.last(*arguments) find(:last, *arguments) end def self.default(options = {}) response = connection.get("/#{self.element_name}/default", options).first response.nil? ? nil : new(response) end private def self.find_single(scope, options) resp = SparkApi.client.get("/idxlinks/#{scope}", options) new(resp.first) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
spark_api-1.3.26 | lib/spark_api/models/idx_link.rb |
spark_api-1.3.25 | lib/spark_api/models/idx_link.rb |