Try this:

```ruby
[1,2,3].inject({}) {|nums, num| nums[num] = num}
```