B
Balint Erdi
Hi,
Deleting (vs. just fetching) the hash key from an options hash that
was passed in as an argument to the method seems prevalent. I saw it
in several high-quality OS projects (e.g DataMapper, Rails)
For example:
unless options.deleteonly_path)
url << (options.deleteprotocol) || 'http')
url << '://' unless url.match("://")
...
end
I wonder what advantage the above snippet has instead of writing:
unless options[nly_path]
url << (options[rotocol] || 'http')
url << '://' unless url.match("://")
...
end
Thank you,
Balint
Deleting (vs. just fetching) the hash key from an options hash that
was passed in as an argument to the method seems prevalent. I saw it
in several high-quality OS projects (e.g DataMapper, Rails)
For example:
unless options.deleteonly_path)
url << (options.deleteprotocol) || 'http')
url << '://' unless url.match("://")
...
end
I wonder what advantage the above snippet has instead of writing:
unless options[nly_path]
url << (options[rotocol] || 'http')
url << '://' unless url.match("://")
...
end
Thank you,
Balint