class Garage::TokenScope::Scope

Attributes

description[R]

Public Class Methods

new(sym, options={}) click to toggle source
# File lib/garage/token_scope.rb, line 101
def initialize(sym, options={})
  @sym = sym
  @access = []
  @hidden = options[:hidden]
  @description = options[:desc]
end

Public Instance Methods

access(action, klass) click to toggle source
# File lib/garage/token_scope.rb, line 113
def access(action, klass)
  @access << [klass.to_s, action]
end
accessible_resources() click to toggle source
# File lib/garage/token_scope.rb, line 117
def accessible_resources
  @access
end
hidden?() click to toggle source
# File lib/garage/token_scope.rb, line 125
def hidden?
  !!@hidden
end
name() click to toggle source
# File lib/garage/token_scope.rb, line 108
def name
  @sym.to_s
end
Also aliased as: to_s
optional?() click to toggle source
# File lib/garage/token_scope.rb, line 129
def optional?
  @sym != :public && !hidden?
end
to_s()
Alias for: name
to_sym() click to toggle source
# File lib/garage/token_scope.rb, line 121
def to_sym
  @sym
end