class Trestle::Scopes::Block

Attributes

block[R]

Public Class Methods

new(&block) click to toggle source
# File lib/trestle/scopes/block.rb, line 6
def initialize(&block)
  @block = block
end

Public Instance Methods

scopes(context) click to toggle source

Evaluates the scope block within the given admin context and returns an array of the scopes that were defined.

# File lib/trestle/scopes/block.rb, line 12
def scopes(context)
  context = Evaluator.new(context)
  context.instance_exec(context, &block)
  context.scopes
end