@@ -4,44 +4,15 @@ class IdxLink < Base
4
4
5
5
extend Finders
6
6
7
- self . element_name = "idxlinks"
7
+ self . element_name = "idxlinks"
8
8
9
9
LINK_TYPES = [ "QuickSearch" , "SavedSearch" , "MyListings" , "Roster" ]
10
10
11
- #TODO Work all below into common base class
12
- def self . find ( *arguments )
13
- scope = arguments . slice! ( 0 )
14
- options = arguments . slice! ( 0 ) || { }
15
-
16
- case scope
17
- when :all then find_every ( options )
18
- when :first then find_every ( options ) . first
19
- when :last then find_every ( options ) . last
20
- when :one then find_one ( options )
21
- else find_single ( scope , options )
22
- end
23
- end
24
-
25
- def self . first ( *arguments )
26
- find ( :first , *arguments )
27
- end
28
-
29
- def self . last ( *arguments )
30
- find ( :last , *arguments )
31
- end
32
-
33
11
def self . default ( options = { } )
34
12
response = connection . get ( "/#{ self . element_name } /default" , options ) . first
35
13
response . nil? ? nil : new ( response )
36
14
end
37
15
38
- private
39
-
40
- def self . find_single ( scope , options )
41
- resp = SparkApi . client . get ( "/idxlinks/#{ scope } " , options )
42
- new ( resp . first )
43
- end
44
-
45
16
end
46
17
end
47
18
end
0 commit comments