brentano 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brentano (0.0.1)
4
+ brentano (0.0.2)
5
5
  activerecord (~> 3)
6
6
  activesupport (~> 3)
7
7
  hashie (>= 0.4)
@@ -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
@@ -4,9 +4,9 @@
4
4
  module Brentano
5
5
  class Query
6
6
 
7
- attr_accessor_with_default :allowed_methods, [:limit, :offset].freeze
8
- attr_accessor_with_default :allowed_scopes, [].freeze
9
- attr_accessor_with_default :absolute_limit, Brentano.query_limit
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
@@ -1,3 +1,3 @@
1
1
  module Brentano
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: brentano
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
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-03 00:00:00 -04:00
13
+ date: 2011-06-06 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency