Module: Periscope

Defined in:
lib/periscope.rb

Instance Method Summary collapse

Instance Method Details

#periscope(params = {}) ⇒ Object



7
8
9
10
11
# File 'lib/periscope.rb', line 7

def periscope(params = {})
  params.inject(periscope_default_scope) do |chain, (scope, param)|
    periscope_call(chain, scope.to_s, param)
  end
end

#scope_accessible(*scopes) ⇒ Object



2
3
4
5
# File 'lib/periscope.rb', line 2

def scope_accessible(*scopes)
  options = scopes.last.is_a?(Hash) ? scopes.pop : {}
  scopes.each { |s| periscope_options[s.to_s] = options }
end