class ApiGen::Resolver

Attributes

symbol[RW]

Public Class Methods

new(symbol) click to toggle source
# File lib/rhn/apigen.rb, line 40
def initialize symbol
  @symbol = symbol
end

Public Instance Methods

v(*args) click to toggle source
# File lib/rhn/apigen.rb, line 44
def v *args
  base, subpath = @symbol.split '.'

  entry = AccessManager.get base
  raise NotFound, "There's no such object" if entry.nil?

  found = entry.symbols.include?(subpath)
  raise AccessDenied, "You don't have access to this resource" if not found

  inst = entry.factory.new
  inst.send subpath.to_sym, *args
end