Class: StandardConfig::Schema::Drawer
- Inherits:
-
Object
- Object
- StandardConfig::Schema::Drawer
- Defined in:
- lib/standard_config/schema.rb
Overview
Internal DSL driver
Instance Method Summary collapse
-
#initialize(schema) ⇒ Drawer
constructor
A new instance of Drawer.
-
#scope(name, &block) ⇒ Object
scope :base do …
Constructor Details
#initialize(schema) ⇒ Drawer
Returns a new instance of Drawer.
113 114 115 |
# File 'lib/standard_config/schema.rb', line 113 def initialize(schema) @schema = schema end |
Instance Method Details
#scope(name, &block) ⇒ Object
scope :base do … end OR scope :passwordless do … end
118 119 120 121 122 123 |
# File 'lib/standard_config/schema.rb', line 118 def scope(name, &block) name_sym = name.to_sym # Ensure scope exists, then evaluate the block in a scoped context @schema.scope(name_sym) ScopedScope.new(@schema, name_sym).instance_eval(&block) if block_given? end |