Class: Devlin::Scope::Config
- Inherits:
-
Object
- Object
- Devlin::Scope::Config
- Defined in:
- lib/devlin/scope.rb
Overview
The configuration object simplifies the configuration of the scope
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #column(name, definition, *args, &block) ⇒ Object
-
#initialize(scope, params, &block) ⇒ Config
constructor
A new instance of Config.
- #relation(rel) ⇒ Object
Constructor Details
#initialize(scope, params, &block) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 |
# File 'lib/devlin/scope.rb', line 7 def initialize(scope, params, &block) @scope = scope @params = params instance_eval(&block) end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/devlin/scope.rb', line 5 def params @params end |
Instance Method Details
#column(name, definition, *args, &block) ⇒ Object
17 18 19 |
# File 'lib/devlin/scope.rb', line 17 def column(name, definition, *args, &block) @scope.add_column(name, definition, *args, &block) end |
#relation(rel) ⇒ Object
13 14 15 |
# File 'lib/devlin/scope.rb', line 13 def relation(rel) @scope.relation = rel end |