Class: Authorization::DevelopmentSupport::Analyzer::GeneralAuthorizationProcessor

Inherits:
SexpProcessor
  • Object
show all
Defined in:
lib/declarative_authorization/development_support/analyzer.rb

Direct Known Subclasses

MergeableRulesProcessor

Instance Method Summary (collapse)

Constructor Details

- (GeneralAuthorizationProcessor) initialize(analyzer)

Returns a new instance of GeneralAuthorizationProcessor



143
144
145
146
147
148
149
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 143

def initialize(analyzer)
  super()
  self.auto_shift_type = true
  self.require_empty = false
  self.strict = false
  @analyzer = analyzer
end

Instance Method Details

- (Object) analyze(sexp_array)



151
152
153
154
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 151

def analyze (sexp_array)
  process(sexp_array)
  analyze_rules
end

- (Object) analyze_rules



156
157
158
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 156

def analyze_rules
  # to be implemented by specific processor
end

- (Object) process_arglist(exp)



164
165
166
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 164

def process_arglist (exp)
  s(exp.collect {|inner_exp| process(inner_exp).shift})
end

- (Object) process_hash(exp)



168
169
170
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 168

def process_hash (exp)
  s(Hash[*exp.collect {|inner_exp| process(inner_exp).shift}])
end

- (Object) process_iter(exp)



160
161
162
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 160

def process_iter (exp)
  s(:iter, process(exp.shift), process(exp.shift), process(exp.shift))
end

- (Object) process_lit(exp)



172
173
174
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 172

def process_lit (exp)
  s(exp.shift)
end