Skip to content

Commit

Permalink
Mention key in docs and fix some types. [doc]
Browse files Browse the repository at this point in the history
  • Loading branch information
trans committed May 23, 2012
1 parent 3f5840f commit 979b149
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/ostruct2.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenStruct2 is better OpenStruct class. # OpenStruct2 is a better OpenStruct class.
# #
# To demonstrate the weakness of the original OpenStruct, try this IRB session: # To demonstrate the weakness of the original OpenStruct, try this IRB session:
# #
Expand All @@ -15,9 +15,9 @@
# methods: `clone`, `dup`, `freeze`, `hash`, `to_enum`, `to_h`, # methods: `clone`, `dup`, `freeze`, `hash`, `to_enum`, `to_h`,
# `to_s` and `inspect`, as well as `instance_eval` and `instance_exec`. # `to_s` and `inspect`, as well as `instance_eval` and `instance_exec`.
# #
# Also note that `empty`, `eql`, `equal` and `frozen` can be used as members # Also note that `empty`, `eql`, `equal`, `frozen` and `key` can be used as
# but the key-check shorthand of using `?`-methods cannot be used since they # members but the key-check shorthand of using `?`-methods cannot be used since
# have special definitions. # these have special definitions.
# #
# To offset the loss of most methods, OpenStruct provides numerous # To offset the loss of most methods, OpenStruct provides numerous
# bang-methods which can be used to manipulate the data, e.g. `#each!`. # bang-methods which can be used to manipulate the data, e.g. `#each!`.
Expand Down Expand Up @@ -126,7 +126,7 @@ def method_missing(sym, *args, &blk)
case type case type
when '!' when '!'
# TODO: Probably should have an indirect interface to ensure proper # TODO: Probably should have an indirect interface to ensure proper
# functonariluiy in all cases. # functonality in all cases.
@table.public_send(name, *args, &blk) @table.public_send(name, *args, &blk)
when '=' when '='
new_ostruct_member(name) new_ostruct_member(name)
Expand Down

0 comments on commit 979b149

Please sign in to comment.