By overriding Object#methods
, WIN32OLE
might work well with did_you_mean gem. This is experimental.
require 'win32ole' dict = WIN32OLE.new('Scripting.Dictionary') dict.Ade('a', 1) #=> Did you mean? Add
returns array of WIN32OLE_PARAM
object corresponding with method parameters.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') method = WIN32OLE_METHOD.new(tobj, 'SaveAs') p method.params # => [Filename, FileFormat, Password, WriteResPassword, ReadOnlyRecommended, CreateBackup, AccessMode, ConflictResolution, AddToMru, TextCodepage, TextVisualLayout]
Returns the methods available to this delegate object as the union of this object’s and _getobj_ methods.
Explicitly terminate option processing.
Returns true if option processing has terminated, false otherwise.
Returns a new ipaddr built by converting the IPv6 address into a native IPv4 address. If the IP address is not an IPv4-mapped or IPv4-compatible IPv6 address, returns self.
Returns true
if this is an orthogonal matrix Raises an error if matrix is not square.
Terminates option parsing. Optional parameter arg
is a string pushed back to be the first non-option argument.
Add separator in summary.
Terminates thr
and schedules another thread to be run, returning the terminated Thread
. If this is the main thread, or the last thread, exits the process.
Returns the name at the definition of the current method as a Symbol
. If called outside of a method, it returns nil
.
Returns x/y
or arg
as a Rational
.
Rational(2, 3) #=> (2/3) Rational(5) #=> (5/1) Rational(0.5) #=> (1/2) Rational(0.3) #=> (5404319552844595/18014398509481984) Rational("2/3") #=> (2/3) Rational("0.3") #=> (3/10) Rational("10 cents") #=> ArgumentError Rational(nil) #=> TypeError Rational(1, nil) #=> TypeError Rational("10 cents", exception: false) #=> nil
Syntax of the string form:
string form = extra spaces , rational , extra spaces ; rational = [ sign ] , unsigned rational ; unsigned rational = numerator | numerator , "/" , denominator ; numerator = integer part | fractional part | integer part , fractional part ; denominator = digits ; integer part = digits ; fractional part = "." , digits , [ ( "e" | "E" ) , [ sign ] , digits ] ; sign = "-" | "+" ; digits = digit , { digit | "_" , digit } ; digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; extra spaces = ? \s* ? ;
See also String#to_r
.
Returns the /etc/passwd information for the user with specified login name
.
The information is returned as a Passwd
struct.
See the unix manpage for getpwnam(3)
for more detail.
Etc.getpwnam('root') #=> #<struct Etc::Passwd name="root", passwd="x", uid=0, gid=0, gecos="root",dir="/root", shell="/bin/bash">
Returns information about the group with specified name
, as found in /etc/group.
The information is returned as a Group
struct.
See the unix manpage for getgrnam(3)
for more detail.
Etc.getgrnam('users') #=> #<struct Etc::Group name="users", passwd="x", gid=100, mem=["meta", "root"]>
Returns the path to the trusted certificate with the given ASN.1 name
Returns a list of the private instance methods defined in mod. If the optional parameter is false
, the methods of any ancestors are not included.
module Mod def method1() end private :method1 def method2() end end Mod.instance_methods #=> [:method2] Mod.private_instance_methods #=> [:method1]
Returns true
if the named private method is defined by mod. If inherit is set, the lookup will also search mod’s ancestors. String
arguments are converted to symbols.
module A def method1() end end class B private def method2() end end class C < B include A def method3() end end A.method_defined? :method1 #=> true C.private_method_defined? "method1" #=> false C.private_method_defined? "method2" #=> true C.private_method_defined? "method2", true #=> true C.private_method_defined? "method2", false #=> false C.method_defined? "method2" #=> false
Makes existing class methods private. Often used to hide the default constructor new
.
String
arguments are converted to symbols. An Array
of Symbols and/or Strings are also accepted.
class SimpleSingleton # Not thread safe private_class_method :new def SimpleSingleton.create(*args, &block) @me = new(*args, &block) if ! @me @me end end
Returns the method identifier for the given object
.
class A include ObjectSpace def foo trace_object_allocations do obj = Object.new p "#{allocation_class_path(obj)}##{allocation_method_id(obj)}" end end end A.new.foo #=> "Class#new"
See ::trace_object_allocations
for more information and examples.
Sets a list of characters that cause a filename to be quoted by the completer when they appear in a completed filename. The default is nil.
Raises NotImplementedError
if the using readline library does not support.