new

new(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = DEFAULT_PARSER, arg_check = false) Class Public methods Args scheme Protocol scheme, i.e. 'http','ftp','mailto' and so on. userinfo User name and password, i.e. 'sdmitry:bla' host Server host name port Server port registry Registry of naming authorities. path Path on server opaque Opaque part query Query data fragment A part of URI after '#' sign parser Parser fo

setup_pager

setup_pager() Instance Public methods Sets up a pager program to pass output through. Tries the RI_PAGER and PAGER environment variables followed by pager, less then more.

accept_nonblock

unixserver.accept_nonblock => unixsocket Instance Public methods Accepts an incoming connection using accept(2) after O_NONBLOCK is set for the underlying file descriptor. It returns an accepted UNIXSocket for the incoming connection. Example require 'socket' serv = UNIXServer.new("/tmp/sock") begin # emulate blocking accept sock = serv.accept_nonblock rescue IO::WaitReadable, Errno::EINTR IO.select([serv]) retry end # sock is an accepted socket. Refer to Socket#accept f

index

index(idx) Instance Public methods

key?

key?(oid) Instance Public methods

try

try(*args) Instance Public methods Calling try on nil always returns nil. It becomes specially helpful when navigating through associations that may return nil. nil.try(:name) # => nil Without try @person && !@person.children.blank? && @person.children.first.name With try @person.try(:children).try(:first).try(:name)

new

new(xml_path) Class Public methods

mattr_reader

mattr_reader(*syms) Instance Public methods Defines a class attribute and creates a class and instance reader methods. The underlying the class variable is set to nil, if it is not previously defined. module HairColors mattr_reader :hair_colors end HairColors.hair_colors # => nil HairColors.class_variable_set("@@hair_colors", [:brown, :black]) HairColors.hair_colors # => [:brown, :black] The attribute name must be a valid method name in Ruby. module Foo mattr_reader :"1

string_to_array

string_to_array(string, oid) Instance Public methods

out

out(key, obj) Instance Public methods