Skip to content

Commit a901df2

Browse files
committed
[DOC] Fix code markups [ci skip]
Backquotes are not special characters in RDoc.
1 parent c535a40 commit a901df2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/ostruct.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@
9393
# o.methods = [:foo, :bar]
9494
# o.methods # => [:foo, :bar]
9595
#
96-
# To help remedy clashes, OpenStruct uses only protected/private methods ending with `!`
97-
# and defines aliases for builtin public methods by adding a `!`:
96+
# To help remedy clashes, OpenStruct uses only protected/private methods ending with <code>!</code>
97+
# and defines aliases for builtin public methods by adding a <code>!</code>:
9898
#
9999
# o = OpenStruct.new(make: 'Bentley', class: :luxury)
100100
# o.class # => :luxury
101101
# o.class! # => OpenStruct
102102
#
103-
# It is recommended (but not enforced) to not use fields ending in `!`;
103+
# It is recommended (but not enforced) to not use fields ending in <code>!</code>;
104104
# Note that a subclass' methods may not be overwritten, nor can OpenStruct's own methods
105-
# ending with `!`.
105+
# ending with <code>!</code>.
106106
#
107107
# For all these reasons, consider not using OpenStruct at all.
108108
#
@@ -279,7 +279,7 @@ def freeze
279279
# :call-seq:
280280
# ostruct[name] -> object
281281
#
282-
# Returns the value of an attribute, or `nil` if there is no such attribute.
282+
# Returns the value of an attribute, or +nil+ if there is no such attribute.
283283
#
284284
# require "ostruct"
285285
# person = OpenStruct.new("name" => "John Smith", "age" => 70)
@@ -452,7 +452,7 @@ def init_with(coder) # :nodoc:
452452
update_to_values!(h)
453453
end
454454

455-
# Make all public methods (builtin or our own) accessible with `!`:
455+
# Make all public methods (builtin or our own) accessible with <code>!</code>:
456456
instance_methods.each do |method|
457457
new_name = "#{method}!"
458458
alias_method new_name, method

0 commit comments

Comments
 (0)