Optruct
Optruct provides simple Hash-Struct mapping feature.
It is designed for largely handling given arguments to method as options.
Use cases
class Stuff
include Optruct
def initialize(a, b, opts={})
@option = optruct :ignore_blank, :auto_detect, :force do
set :ignore_blank => true, :auto_detect => false, :force => false
set opts
end
if @option.auto_detect
# do something
end
end
end