summaryrefslogtreecommitdiff
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-28 21:18:11 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-28 21:18:11 +0000
commitaf29f7d2a36647463b5afdc54c5fa4f7cf9e4275 (patch)
treecd71f67d2cba6427f35f974783533f406dbc6a2b /lib/ostruct.rb
parent8c163b8599e4e86461c05e1bc464de1499b0ba8b (diff)
* lib/ostruct.rb: Remove rdoc details on marshal_{load|dump} and fix rdoc
[ruby-core:42557] [ruby-core:42780] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb26
1 files changed, 4 insertions, 22 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 167b682..084622c 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -114,32 +114,14 @@ class OpenStruct
end
#
- # Provides marshalling support for use by the Marshal library. Returning the
- # underlying Hash table that contains the functions defined as the keys and
- # the values assigned to them.
- #
- # require 'ostruct'
- #
- # person = OpenStruct.new
- # person.name = 'John Smith'
- # person.age = 70
- #
- # person.marshal_dump # => { :name => 'John Smith', :age => 70 }
+ # Provides marshalling support for use by the Marshal library.
#
def marshal_dump
@table
end
#
- # Provides marshalling support for use by the Marshal library. Accepting
- # a Hash of keys and values which will be used to populate the internal table
- #
- # require 'ostruct'
- #
- # event = OpenStruct.new
- # hash = { 'time' => Time.now, 'title' => 'Birthday Party' }
- # event.marshal_load(hash)
- # event.title # => 'Birthday Party'
+ # Provides marshalling support for use by the Marshal library.
#
def marshal_load(x)
@table = x
@@ -147,7 +129,7 @@ class OpenStruct
end
#
- # #modifiable is used internally to check if the OpenStruct is able to be
+ # Used internally to check if the OpenStruct is able to be
# modified before granting access to the internal Hash table to be modified.
#
def modifiable
@@ -240,7 +222,7 @@ class OpenStruct
#
# Compares this object and +other+ for equality. An OpenStruct is equal to
- # +other+ when +other+ is an OpenStruct and the two object's Hash tables are
+ # +other+ when +other+ is an OpenStruct and the two objects' Hash tables are
# equal.
#
def ==(other)