Class: CollectiveIdea::NamedScope::Scope
- Inherits:
-
Object
- Object
- CollectiveIdea::NamedScope::Scope
- Extends:
- Module
- Defined in:
- vendor/plugins/awesome_nested_set/lib/awesome_nested_set/named_scope.rb
Overview
:nodoc:
Instance Attribute Summary
-
- (Object) proxy_options
readonly
Returns the value of attribute proxy_options.
-
- (Object) proxy_scope
readonly
Returns the value of attribute proxy_scope.
Instance Method Summary
-
- (Scope) initialize(proxy_scope, options, &block)
constructor
A new instance of Scope.
- - (Object) reload
Constructor Details
- (Scope) initialize(proxy_scope, options, &block)
A new instance of Scope
109 110 111 112 113 |
# File 'vendor/plugins/awesome_nested_set/lib/awesome_nested_set/named_scope.rb', line 109 def initialize(proxy_scope, , &block) [[:extend]].flatten.each { |extension| extend extension } if [:extend] extend Module.new(&block) if block_given? @proxy_scope, = proxy_scope, .except(:extend) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(method, *args, &block) (private)
125 126 127 128 129 130 131 132 133 |
# File 'vendor/plugins/awesome_nested_set/lib/awesome_nested_set/named_scope.rb', line 125 def method_missing(method, *args, &block) if scopes.include?(method) scopes[method].call(self, *args) else with_scope :find => do proxy_scope.send(method, *args, &block) end end end |
Instance Attribute Details
- (Object) proxy_options (readonly)
Returns the value of attribute proxy_options
105 106 107 |
# File 'vendor/plugins/awesome_nested_set/lib/awesome_nested_set/named_scope.rb', line 105 def end |
- (Object) proxy_scope (readonly)
Returns the value of attribute proxy_scope
105 106 107 |
# File 'vendor/plugins/awesome_nested_set/lib/awesome_nested_set/named_scope.rb', line 105 def proxy_scope @proxy_scope end |
Instance Method Details
- (Object) reload
115 116 117 |
# File 'vendor/plugins/awesome_nested_set/lib/awesome_nested_set/named_scope.rb', line 115 def reload load_found; self end |