Skip to content

Commit 26ea134

Browse files
harryuan65marcandre
authored andcommitted
Update README.md
Hello ! I just want to add `ruby` to markdown code blocks for cleaner look
1 parent ce879e5 commit 26ea134

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The `ostruct` library comes pre-packaged with Ruby. No installation is necessary
88

99
## Usage
1010

11-
```
11+
```ruby
1212
require "ostruct"
1313

1414
person = OpenStruct.new
@@ -22,14 +22,14 @@ The `ostruct` library comes pre-packaged with Ruby. No installation is necessary
2222

2323
An OpenStruct employs a Hash internally to store the attributes and values and can even be initialized with one:
2424

25-
```
25+
```ruby
2626
australia = OpenStruct.new(:country => "Australia", :capital => "Canberra")
2727
# => #<OpenStruct country="Australia", capital="Canberra">
2828
```
2929

3030
Hash keys with spaces or characters that could normally not be used for method calls (e.g. <code>()[]*</code>) will not be immediately available on the OpenStruct object as a method for retrieval or assignment, but can still be reached through the Object#send method.
3131

32-
```
32+
```ruby
3333
measurements = OpenStruct.new("length (in inches)" => 24)
3434
measurements.send("length (in inches)") # => 24
3535

@@ -41,7 +41,7 @@ Hash keys with spaces or characters that could normally not be used for method c
4141

4242
Removing the presence of an attribute requires the execution of the delete_field method as setting the property value to +nil+ will not remove the attribute.
4343

44-
```
44+
```ruby
4545
first_pet = OpenStruct.new(:name => "Rowdy", :owner => "John Smith")
4646
second_pet = OpenStruct.new(:name => "Rowdy")
4747

0 commit comments

Comments
 (0)