class Ua::Util::Helper

Public Class Methods

new(obj) click to toggle source
# File lib/ua/util.rb, line 4
def initialize(obj)
        @obj = obj
end

Public Instance Methods

[](*args) click to toggle source
# File lib/ua/util.rb, line 8
def [](*args)
        if args.size == 1
                @obj[args[0]]
        else
                args.map{|x| @obj[x]}
        end
end
Also aliased as: values_at
[]=(*args) click to toggle source
# File lib/ua/util.rb, line 19
def []=(*args)
        last = args.pop(1)
        args.zip(last).each{|k|
                a,b = k
                @obj[a] = b
        }
end
app() click to toggle source
# File lib/ua/util.rb, line 32
def app
  render :app
end
define_context(name, &block) click to toggle source
# File lib/ua/util.rb, line 27
def define_context(name, &block)
  app = Ua::Application.top.app
  app.context @obj.prototype, name, &block 
end
render(ctxt = Ua::Application.top.context) click to toggle source
# File lib/ua/util.rb, line 36
def render(ctxt = Ua::Application.top.context)
  context(@obj, ctxt)
end
values_at(*args)
Alias for: []