Skip to content

Commit

Permalink
removes p calls in rdoc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed Feb 6, 2010
1 parent f3e41e0 commit 81535d0
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Module class Module
# Returns the name of the module containing this one. # Returns the name of the module containing this one.
# #
# p M::N.parent_name # => "M" # M::N.parent_name # => "M"
def parent_name def parent_name
unless defined? @parent_name unless defined? @parent_name
@parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil @parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil
Expand All @@ -19,13 +19,13 @@ def parent_name
# end # end
# X = M::N # X = M::N
# #
# p M::N.parent # => M # M::N.parent # => M
# p X.parent # => M # X.parent # => M
# #
# The parent of top-level and anonymous modules is Object. # The parent of top-level and anonymous modules is Object.
# #
# p M.parent # => Object # M.parent # => Object
# p Module.new.parent # => Object # Module.new.parent # => Object
# #
def parent def parent
parent_name ? ActiveSupport::Inflector.constantize(parent_name) : Object parent_name ? ActiveSupport::Inflector.constantize(parent_name) : Object
Expand All @@ -40,9 +40,9 @@ def parent
# end # end
# X = M::N # X = M::N
# #
# p M.parents # => [Object] # M.parents # => [Object]
# p M::N.parents # => [M, Object] # M::N.parents # => [M, Object]
# p X.parents # => [M, Object] # X.parents # => [M, Object]
# #
def parents def parents
parents = [] parents = []
Expand Down

0 comments on commit 81535d0

Please sign in to comment.