Class: AS_SafeObject

Inherits:
Object
  • Object
show all
Defined in:
lib/_appscript/safeobject.rb

Constant Summary collapse

EXCLUDE =
ReservedKeywords + [
                                "Array",
                                "Float",
                                "Integer",
                                "String",
                                "`",
                                "abort",
                                "at_exit",
                                "autoload",
                                "autoload?",
                                "binding",
                                "block_given?",
                                "callcc",
                                "caller",
                                "catch",
                                "chomp",
                                "chomp!",
                                "chop",
                                "chop!",
                                "eval",
                                "exec",
                                "exit",
                                "exit!",
                                "fail",
                                "fork",
                                "format",
                                "getc",
                                "gets",
                                "global_variables",
                                "gsub",
                                "gsub!",
                                "initialize",
                                "initialize_copy",
                                "iterator?",
                                "lambda",
                                "load",
                                "local_variables",
                                "loop",
                                "open",
                                "p",
                                "print",
                                "printf",
                                "proc",
                                "putc",
                                "puts",
                                "raise",
                                "rand",
                                "readline",
                                "readlines",
                                "remove_instance_variable",
                                "require",
                                "scan",
                                "select",
                                "set_trace_func",
                                "singleton_method_added",
                                "singleton_method_removed",
                                "singleton_method_undefined",
                                "sleep",
                                "split",
                                "sprintf",
                                "srand",
                                "sub",
                                "sub!",
                                "syscall",
                                "system",
                                "test",
                                "throw",
                                "trace_var",
                                "trap",
                                "untrace_var",
                                "warn"
                               ] + [
 /^__/, /^instance_/, /^object_/, /\?$/, /^\W$/,
]

Class Method Summary collapse

Class Method Details

.hide(name) ⇒ Object



204
205
206
207
208
209
210
# File 'lib/_appscript/safeobject.rb', line 204

def self.hide(name)
  case name.to_s # Ruby1.9 returns method names as symbols, not strings as in 1.8
  when *EXCLUDE
  else
    undef_method(name) rescue nil
  end
end