Skip to content

Instantly share code, notes, and snippets.

@costis
Created January 30, 2012 23:39
Show Gist options
  • Save costis/1707556 to your computer and use it in GitHub Desktop.
Save costis/1707556 to your computer and use it in GitHub Desktop.
inspect
80 def inspect
81 variables = (instance_variables - uninspect_variables).collect do |name|
82 "%s=%s" % [name, instance_variable_get(name)]
83 end.join(' ')
84 uninspect = uninspect_variables.collect do |name|
85 var = instance_variable_get name
86 "%s=%s[%i]" % [name, var.class, var.size]
87 end.join(' ')
88 sprintf "#<%s:0x%014x %s %s>", self.class, object_id,
89 variables, uninspect
90 end
91 def uninspect_variables # :nodoc:
92 %w{@formats @fonts @worksheets}
93 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment