That's an ugly fix, that `||` will also fail if `@doc[name.to_s]` is `null` (ie. not only if it's a `boolean?` property).

You shouldn't really be relying on the truthiness of the value of that element when what you're really trying to do is specify a default when there's no key (right?).

So, if you use `has_key?` then you get away from the need to make the `boolean?` determination at all.

```ruby
define_method(name) do
  key = name.to_s
  property.value = @doc.has_key? key ? @doc[key] : default_value
end
```