brentano 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/lib/brentano.rb +9 -3
- data/lib/brentano/query.rb +15 -3
- data/lib/brentano/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/lib/brentano.rb
CHANGED
@@ -5,14 +5,20 @@ module Brentano
|
|
5
5
|
autoload :Presenter, 'brentano/presenter'
|
6
6
|
autoload :Query, 'brentano/query'
|
7
7
|
|
8
|
-
mattr_accessor :query_limit
|
9
|
-
@@query_limit = 20
|
10
|
-
|
11
8
|
mattr_accessor :qualifier_key
|
12
9
|
@@qualifier_key = :options
|
13
10
|
|
14
11
|
mattr_accessor :presenter_module
|
15
12
|
@@presenter_module = "Presenters"
|
13
|
+
|
14
|
+
mattr_accessor :allowed_methods
|
15
|
+
@@allowed_methods = [ :limit, :offset ]
|
16
|
+
|
17
|
+
mattr_accessor :allowed_scopes
|
18
|
+
@@allowed_scopes = [ ]
|
19
|
+
|
20
|
+
mattr_accessor :absolute_limit
|
21
|
+
@@absolute_limit = 20
|
16
22
|
|
17
23
|
def config
|
18
24
|
yield self
|
data/lib/brentano/query.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
module Brentano
|
5
5
|
class Query
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
attr_writer :allowed_methods
|
8
|
+
attr_writer :allowed_scopes
|
9
|
+
attr_writer :absolute_limit
|
10
10
|
|
11
11
|
def self.finish(relation, options)
|
12
12
|
obj = self.new relation
|
@@ -31,6 +31,18 @@ module Brentano
|
|
31
31
|
r
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
def allowed_methods
|
36
|
+
@allowed_methods ||= Brentano.allowed_methods.dup
|
37
|
+
end
|
38
|
+
|
39
|
+
def allowed_scopes
|
40
|
+
@allowed_scopes ||= Brentano.allowed_scopes.dup
|
41
|
+
end
|
42
|
+
|
43
|
+
def absolute_limit
|
44
|
+
@absolute_limit ||= Brentano.absolute_limit
|
45
|
+
end
|
34
46
|
|
35
47
|
def initialize(relation)
|
36
48
|
@relation = relation
|
data/lib/brentano/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: brentano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Roberto Thais
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-06 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|