class Browserino::Options
Public Class Methods
new(options = {})
click to toggle source
# File lib/browserino/options.rb, line 5 def initialize(options = {}) @options = options end
Public Instance Methods
merge(other)
click to toggle source
# File lib/browserino/options.rb, line 19 def merge(other) @options.merge! other self end
method_missing(sym, *args)
click to toggle source
# File lib/browserino/options.rb, line 9 def method_missing(sym, *args) return @options[opt(sym)] == args.first if args.any? @options[opt(sym)] end
respond_to_missing?(sym, *)
click to toggle source
# File lib/browserino/options.rb, line 15 def respond_to_missing?(sym, *) option? sym end
to_a()
click to toggle source
# File lib/browserino/options.rb, line 32 def to_a @options.to_a end
to_h()
click to toggle source
# File lib/browserino/options.rb, line 28 def to_h @options end
to_hash()
click to toggle source
# File lib/browserino/options.rb, line 24 def to_hash @options end
to_s()
click to toggle source
# File lib/browserino/options.rb, line 36 def to_s @options.to_s end
to_str()
click to toggle source
# File lib/browserino/options.rb, line 40 def to_str to_s end
Private Instance Methods
opt(sym)
click to toggle source
# File lib/browserino/options.rb, line 46 def opt(sym) sym.to_s.tr('?', '').to_sym end
option?(sym)
click to toggle source
# File lib/browserino/options.rb, line 50 def option?(sym) @options.key? opt(sym) end