module Ua::Util

Public Instance Methods

istr(str) click to toggle source
# File lib/ua/util.rb, line 74
def istr(str)
  first = str[/^\s*(\S)/, 1]
  str.split("\n").map{|x| x.sub(/^\s*#{Regexp.escape(first)}/, "")}.join("\n")
end
ua(obj_or_str) click to toggle source
# File lib/ua/util.rb, line 40
def ua(obj_or_str)
        if Ua::Application::UAClass === obj_or_str
                return Helper.new(obj_or_str)
        elsif String === obj_or_str
                return Helper.new(Ua::Application.top_app.get(obj_or_str))
        end
        raise ArgumentError, "Don't know how to make ua from #{obj_or_str}", caller(3)
end
uapp(app = Ua::Application.top_app) click to toggle source
# File lib/ua/util.rb, line 70
def uapp(app = Ua::Application.top_app)
        AppHelper.new(app)
end