bcx 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,33 +0,0 @@
1
- module Rapidash
2
- module Collection
3
-
4
- def self.included(base)
5
- base.extend ClassMethods
6
- end
7
-
8
- module ClassMethods
9
- def collection(name, attrs = {})
10
- path = attrs[:path] || name.to_s
11
- path.gsub!(/^\//, '')
12
-
13
- method = attrs[:method] || :get
14
-
15
- define_method("#{name}!") do
16
- original_url = @url
17
-
18
- @url += "/#{path}"
19
- @options[:method] = method
20
- result = call!
21
-
22
- @url = original_url
23
-
24
- result
25
- end
26
- end
27
- end
28
- end
29
- end
30
-
31
- class Rapidash::Base
32
- include Rapidash::Collection
33
- end