uniq!

ary.uniq! â ary or nilary.uniq! { |item| ... } â ary or nil Instance Public methods Removes duplicate elements from self. If a block is given, it will use the return value of the block for comparison. It compares values using their hash and eql? methods for efficiency. Returns nil if no changes are made (that is, no duplicates are found). a = [ "a", "a", "b", "b", "c" ] a.uniq! # => ["a", "b", "c"] b = [ "a", "b", "c" ] b.uniq! # => nil c = [["student","

find

find(*args) Instance Public methods Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]). If no record can be found for all of the listed ids, then RecordNotFound will be raised. If the primary key is an integer, find by id coerces its arguments using to_i. Person.find(1) # returns the object for ID = 1 Person.find("1") # returns the object for ID = 1 Person.find("31-sarah") # returns the object for ID = 31 Pers

ipv6_linklocal?

ipv6_linklocal?() Instance Public methods Returns true for IPv6 link local address (ff80::/10). It returns false otherwise.

latin_actual_hash_displayof

latin_actual_hash_displayof(win, option=nil) Instance Public methods

new

new(hash=nil) Class Public methods Creates a new OpenStruct object. By default, the resulting OpenStruct object will have no attributes. The optional hash, if given, will generate attributes and values (can be a Hash, an OpenStruct or a Struct). For example: require 'ostruct' hash = { "country" => "Australia", :population => 20_000_000 } data = OpenStruct.new(hash) p data # -> <OpenStruct country="Australia" population=20000000>

period

period() Instance Public methods Returns the underlying TZInfo::TimezonePeriod.

getpwuid

getpwuid(uid) â Passwd Class Public methods Returns the /etc/passwd information for the user with the given integer uid. The information is returned as a Passwd struct. If uid is omitted, the value from Passwd[:uid] is returned instead. See the unix manpage for getpwuid(3) for more detail. Example: Etc.getpwuid(0) #=> #<struct Struct::Passwd name="root", passwd="x", uid=0, gid=0, gecos="root",dir="/root", shell="/bin/bash">

_ip_id_

_ip_id_() Class Public methods

load_tclscript_rsrc

load_tclscript_rsrc(resource_name, file=None) Class Public methods

numerator

cmp.numerator â numeric Instance Public methods Returns the numerator. 1 2 3+4i <- numerator - + -i -> ---- 2 3 6 <- denominator c = Complex('1/2+2/3i') #=> ((1/2)+(2/3)*i) n = c.numerator #=> (3+4i) d = c.denominator #=> 6 n / d #=> ((1/2)+(2/3)*i) Complex(Rational(n.real, d), Rational(n.imag, d)) #=> ((1/2)+(2/3)*i) See denominator.