You got the second one totally right. However 2 improvements. I'd name id `default_element_styles`. And in Ruby you can even use the class as a key in a has  which makes lookup easier: `default_element_styles[Arc] = ....`

Writing it the best would probably to have global default styles and then build on those. E.g.:

```
DEFAULT_STYLES = {... stroke: black}
default_element_styles[Arc] = DEFAULT_STYLES.merge SPECIFIC_ARC_STYLES
default_element_styles[Rect] = DEFAULT_STYLES.merge SPECIFIC_RECT_STYLES
```

----------------------------------------------------------

In contrast to that with the first idea I tried to convey the following idea:

```ruby
global_default_styles = {... stroke: blake ...} #or from a constant whatever
element_default_styles[Class] = {....} # something but it does NOT duplicate styles from the global default styles unless they are overwritten 
```

Then when we have to look up the styles for a specific class we'd need to merge them together:

```ruby
def look_up_default_style_for(klazz)
  global_default_styles.merge(element_default_styles[klazz])
end
```

whereas the other approach would give us this data structure instantly. But with the other approach (in this post first, in the original post second... sorry for the confusion) we have to do the iteration every time we change styles. We have to make sure not to run out of sync and it takes a bit more time when changing global styles (due to the iteration). However the lookup for styles should be faster there as no merge operations are happening but we'd need to benchmark the impact of that.

For now both seem fine to me.