Ticket #726: test.rb
| File test.rb, 397 bytes (added by dylan@…, 2 years ago) |
|---|
| Line | |
|---|---|
| 1 | class String |
| 2 | #----------------------------------------------------------------------------- |
| 3 | |
| 4 | def cook |
| 5 | puts 'Bacon!' |
| 6 | end |
| 7 | |
| 8 | def to_mutable_attributed_string |
| 9 | NSMutableAttributedString.alloc.initWithString( self ) |
| 10 | end |
| 11 | end |
| 12 | |
| 13 | base_string = 'breakfast' |
| 14 | |
| 15 | puts base_string.class |
| 16 | base_string.cook |
| 17 | |
| 18 | mutable = base_string.to_mutable_attributed_string |
| 19 | |
| 20 | puts mutable.string.class |
| 21 | mutable.string.cook |
| 22 |

