class

Object

v2_1_10 - Show latest stable

Object is the default root of all Ruby objects. Object inherits from BasicObject which allows creating alternate object hierarchies. Methods on Object are available to all classes unless explicitly overridden.

Object mixes in the Kernel module, making the built-in kernel functions globally accessible. Although the instance methods of Object are defined by the Kernel module, we have chosen to document them here for clarity.

When referencing constants in classes inheriting from Object you do not need to use the full namespace. For example, referencing File inside YourClass will find the top-level File class.

In the descriptions of Object’s methods, the parameter symbol refers to a symbol, which is either a quoted string or a Symbol (such as :name).

Included modules

  • Benchmark
  • Kernel
  • MakeMakefile
  • MiniTest::Expectations
  • PP::ObjectMixin

Constants

ARGF = argf

ARGV = rb_argv

DATA = f

DependencyConflict = Gem::Resolver::Conflict # :nodoc:

DependencyResolver = Gem::Resolver # :nodoc:

ENV = envtbl

FALSE = Qfalse

HTML_ENTITIES = {\n"AElig" => [0x000C6],\n"AMP" => [0x00026],\n"Aacute" => [0x000C1],\n"Abreve" => [0x00102],\n"Acirc" => [0x000C2],\n"Acy" => [0x00410],\n"Afr" => [0x1D504],\n"Agrave" => [0x000C0],\n"Alpha" => [0x00391],\n"Amacr" => [0x00100],\n"And" => [0x02A53],\n"Aogon" => [0x00104],\n"Aopf" => [0x1D538],\n"ApplyFunction" => [0x02061],\n"Aring" => [0x000C5],\n"Ascr" => [0x1D49C],\n"Assign" => [0x02254],\n"Atilde" => [0x000C3],\n"Auml" => [0x000C4],\n"Backslash" => [0x02216],\n"Barv" => [0x02AE7],\n"Barwed" => [0x02306],\n"Bcy" => [0x00411],\n"Because" => [0x02235],\n"Bernoullis" => [0x0212C],\n"Beta" => [0x00392],\n"Bfr" => [0x1D505],\n"Bopf" => [0x1D539],\n"Breve" => [0x002D8],\n"Bscr" => [0x0212C],\n"Bumpeq" => [0x0224E],\n"CHcy" => [0x00427],\n"COPY" => [0x000A9],\n"Cacute" => [0x00106],\n"Cap" => [0x022D2],\n"CapitalDifferentialD" => [0x02145],\n"Cayleys" => [0x0212D],\n"Ccaron" => [0x0010C],\n"Ccedil" => [0x000C7],\n"Ccirc" => [0x00108],\n"Cconint" => [0x02230],\n"Cdot" => [0x0010A],\n"Cedilla" => [0x000B8],\n"CenterDot" => [0x000B7],\n"Cfr" => [0x0212D],\n"Chi" => [0x003A7],\n"CircleDot" => [0x02299],\n"CircleMinus" => [0x02296],\n"CirclePlus" => [0x02295],\n"CircleTimes" => [0x02297],\n"ClockwiseContourIntegral" => [0x02232],\n"CloseCurlyDoubleQuote" => [0x0201D],\n"CloseCurlyQuote" => [0x02019],\n"Colon" => [0x02237],\n"Colone" => [0x02A74],\n"Congruent" => [0x02261],\n"Conint" => [0x0222F],\n"ContourIntegral" => [0x0222E],\n"Copf" => [0x02102],\n"Coproduct" => [0x02210],\n"CounterClockwiseContourIntegral" => [0x02233],\n"Cross" => [0x02A2F],\n"Cscr" => [0x1D49E],\n"Cup" => [0x022D3],\n"CupCap" => [0x0224D],\n"DD" => [0x02145],\n"DDotrahd" => [0x02911],\n"DJcy" => [0x00402],\n"DScy" => [0x00405],\n"DZcy" => [0x0040F],\n"Dagger" => [0x02021],\n"Darr" => [0x021A1],\n"Dashv" => [0x02AE4],\n"Dcaron" => [0x0010E],\n"Dcy" => [0x00414],\n"Del" => [0x02207],\n"Delta" => [0x00394],\n"Dfr" => [0x1D507],\n"DiacriticalAcute" => [0x000B4],\n"DiacriticalDot" => [0x002D9],\n"DiacriticalDoubleAcute" => [0x002DD],\n"DiacriticalGrave" => [0x00060],\n"DiacriticalTilde" => [0x002DC],\n"Diamond" => [0x022C4],\n"DifferentialD" => [0x02146],\n"Dopf" => [0x1D53B],\n"Dot" => [0x000A8],\n"DotDot" => [0x020DC],\n"DotEqual" => [0x02250],\n"DoubleContourIntegral" => [0x0222F],\n"DoubleDot" => [0x000A8],\n"DoubleDownArrow" => [0x021D3],\n"DoubleLeftArrow" => [0x021D0],\n"DoubleLeftRightArrow" => [0x021D4],\n"DoubleLeftTee" => [0x02AE4],\n"DoubleLongLeftArrow" => [0x027F8],\n"DoubleLongLeftRightArrow" => [0x027FA],\n"DoubleLongRightArrow" => [0x027F9],\n"DoubleRightArrow" => [0x021D2],\n"DoubleRightTee" => [0x022A8],\n"DoubleUpArrow" => [0x021D1],\n"DoubleUpDownArrow" => [0x021D5],\n"DoubleVerticalBar" => [0x02225],\n"DownArrow" => [0x02193],\n"DownArrowBar" => [0x02913],\n"DownArrowUpArrow" => [0x021F5],\n"DownBreve" => [0x00311],\n"DownLeftRightVector" => [0x02950],\n"DownLeftTeeVector" => [0x0295E],\n"DownLeftVector" => [0x021BD],\n"DownLeftVectorBar" => [0x02956],\n"DownRightTeeVector" => [0x0295F],\n"DownRightVector" => [0x021C1],\n"DownRightVectorBar" => [0x02957],\n"DownTee" => [0x022A4],\n"DownTeeArrow" => [0x021A7],\n"Downarrow" => [0x021D3],\n"Dscr" => [0x1D49F],\n"Dstrok" => [0x00110],\n"ENG" => [0x0014A],\n"ETH" => [0x000D0],\n"Eacute" => [0x000C9],\n"Ecaron" => [0x0011A],\n"Ecirc" => [0x000CA],\n"Ecy" => [0x0042D],\n"Edot" => [0x00116],\n"Efr" => [0x1D508],\n"Egrave" => [0x000C8],\n"Element" => [0x02208],\n"Emacr" => [0x00112],\n"EmptySmallSquare" => [0x025FB],\n"EmptyVerySmallSquare" => [0x025AB],\n"Eogon" => [0x00118],\n"Eopf" => [0x1D53C],\n"Epsilon" => [0x00395],\n"Equal" => [0x02A75],\n"EqualTilde" => [0x02242],\n"Equilibrium" => [0x021CC],\n"Escr" => [0x02130],\n"Esim" => [0x02A73],\n"Eta" => [0x00397],\n"Euml" => [0x000CB],\n"Exists" => [0x02203],\n"ExponentialE" => [0x02147],\n"Fcy" => [0x00424],\n"Ffr" => [0x1D509],\n"FilledSmallSquare" => [0x025FC],\n"FilledVerySmallSquare" => [0x025AA],\n"Fopf" => [0x1D53D],\n"ForAll" => [0x02200],\n"Fouriertrf" => [0x02131],\n"Fscr" => [0x02131],\n"GJcy" => [0x00403],\n"GT" => [0x0003E],\n"Gamma" => [0x00393],\n"Gammad" => [0x003DC],\n"Gbreve" => [0x0011E],\n"Gcedil" => [0x00122],\n"Gcirc" => [0x0011C],\n"Gcy" => [0x00413],\n"Gdot" => [0x00120],\n"Gfr" => [0x1D50A],\n"Gg" => [0x022D9],\n"Gopf" => [0x1D53E],\n"GreaterEqual" => [0x02265],\n"GreaterEqualLess" => [0x022DB],\n"GreaterFullEqual" => [0x02267],\n"GreaterGreater" => [0x02AA2],\n"GreaterLess" => [0x02277],\n"GreaterSlantEqual" => [0x02A7E],\n"GreaterTilde" => [0x02273],\n"Gscr" => [0x1D4A2],\n"Gt" => [0x0226B],\n"HARDcy" => [0x0042A],\n"Hacek" => [0x002C7],\n"Hat" => [0x0005E],\n"Hcirc" => [0x00124],\n"Hfr" => [0x0210C],\n"HilbertSpace" => [0x0210B],\n"Hopf" => [0x0210D],\n"HorizontalLine" => [0x02500],\n"Hscr" => [0x0210B],\n"Hstrok" => [0x00126],\n"HumpDownHump" => [0x0224E],\n"HumpEqual" => [0x0224F],\n"IEcy" => [0x00415],\n"IJlig" => [0x00132],\n"IOcy" => [0x00401],\n"Iacute" => [0x000CD],\n"Icirc" => [0x000CE],\n"Icy" => [0x00418],\n"Idot" => [0x00130],\n"Ifr" => [0x02111],\n"Igrave" => [0x000CC],\n"Im" => [0x02111],\n"Imacr" => [0x0012A],\n"ImaginaryI" => [0x02148],\n"Implies" => [0x021D2],\n"Int" => [0x0222C],\n"Int

Heading = Struct.new :level, :text do\n\n@to_html = nil\n@to_label = nil\n\n##\n# A singleton RDoc::Markup::ToLabel formatter for headings.\n\ndef self.to_label\n@to_label ||= RDoc::Markup::ToLabel.new\nend\n\n##\n# A singleton plain HTML formatter for headings. Used for creating labels\n# for the Table of Contents\n\ndef self.to_html\nreturn @to_html if @to_html\n\nmarkup = RDoc::Markup.new\nmarkup.add_special RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF\n\n@to_html = RDoc::Markup::ToHtml.new nil\n\ndef @to_html.handle_special_CROSSREF special\nspecial.text.sub(/^\\\\/, '')\nend\n\n@to_html\nend\n\n##\n# Calls #accept_heading on +visitor+\n\ndef accept visitor\nvisitor.accept_heading self\nend\n\n##\n# An HTML-safe anchor reference for this header.\n\ndef aref\n"label-#{self.class.to_label.convert text.dup}"\nend\n\n##\n# Creates a fully-qualified label which will include the label from\n# +context+. This helps keep ids unique in HTML.\n\ndef label context = nil\nlabel = aref\n\nlabel = [context.aref, label].compact.join '-' if\ncontext and context.respond_to? :aref\n\nlabel\nend\n\n##\n# HTML markup of the text of this label without the surrounding header\n# element.\n\ndef plain_html\nself.class.to_html.to_html(text.dup)\nend\n\ndef pretty_print q # :nodoc:\nq.group 2, "[head: #{level} ", ']' do\nq.pp text\nend\nend\n\nend

Math = CMath # :nodoc:

Minitest = MiniTest # :nodoc: because ugh... I typo this all the time

NIL = Qnil

NOENCODING = 32

ParseError = Racc::ParseError

RUBY_COPYRIGHT = MKSTR(copyright)

RUBY_DESCRIPTION = MKSTR(description)

RUBY_ENGINE = ruby_engine_name = MKSTR(engine)

RUBY_PATCHLEVEL = INT2FIX(RUBY_PATCHLEVEL)

RUBY_PLATFORM = MKSTR(platform)

RUBY_RELEASE_DATE = MKSTR(release_date)

RUBY_REVISION = INT2FIX(RUBY_REVISION)

RUBY_VERSION = MKSTR(version)

SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__

STDERR = rb_stderr

STDIN = rb_stdin

STDOUT = rb_stdout

Synchronizer = Sync

Synchronizer_m = Sync_m

TOPLEVEL_BINDING = rb_binding_new()

TRUE = Qtrue

ThWait = ThreadsWait

TimeoutError = Timeout::Error

UnsatisfiableDepedencyError = Gem::UnsatisfiableDependencyError # :nodoc:

YAML = Psych # :nodoc:

Files

  • class.c
  • enumerator.c
  • eval.c
  • ext/digest/lib/digest.rb
  • ext/psych/lib/psych/core_ext.rb
  • ext/psych/lib/psych/deprecated.rb
  • ext/psych/lib/psych/visitors/to_ruby.rb
  • gc.c
  • hash.c
  • io.c
  • lib/English.rb
  • lib/benchmark.rb
  • lib/csv.rb
  • lib/debug.rb
  • lib/delegate.rb
  • lib/irb/ext/use-loader.rb
  • lib/irb/src_encoding.rb
  • lib/irb/xmp.rb
  • lib/mathn.rb
  • lib/minitest/mock.rb
  • lib/minitest/spec.rb
  • lib/minitest/unit.rb
  • lib/mkmf.rb
  • lib/pp.rb
  • lib/racc/parser.rb
  • lib/rdoc/markdown/entities.rb
  • lib/rdoc/markup/heading.rb
  • lib/rexml/xpath_parser.rb
  • lib/rubygems/exceptions.rb
  • lib/rubygems/resolver.rb
  • lib/rubygems/resolver/conflict.rb
  • lib/sync.rb
  • lib/thwait.rb
  • lib/timeout.rb
  • lib/un.rb
  • lib/webrick/httpservlet/cgi_runner.rb
  • lib/yaml.rb
  • object.c
  • proc.c
  • ruby.c
  • version.c
  • vm.c
  • vm_eval.c
  • vm_method.c