class Reflect

Public Class Methods

compare(a,b) click to toggle source
# File lib/lib/reflect.rb, line 29
def Reflect.compare(a,b)
  if a == b 
    return 0
  elsif a > b 
    return 1
  else 
    return -1
  end
end
field(o,field) click to toggle source
# File lib/lib/reflect.rb, line 6
def Reflect.field(o,field)
  begin
    result = o[field]
    result = o[field.to_sym] if result == nil
    return result
  rescue => e
    e = hx_rescued(e)
    return field
  end
end
fields(o) click to toggle source
# File lib/lib/reflect.rb, line 17
def Reflect.fields(o)
  if o.respond_to?("attributes") 
    return o.attributes
  else 
    return o.keys
  end
end
is_function(f) click to toggle source
# File lib/lib/reflect.rb, line 25
def Reflect.is_function(f)
  f.respond_to?("call")
end