class Tidyopt
Ruby interface to Tidylib options.
Public Class Methods
new(doc)
click to toggle source
Construct a new instance.
# File lib/tidy/tidyopt.rb, line 7 def initialize(doc) @doc = doc end
Public Instance Methods
[](name)
click to toggle source
Reader for options (Hash syntax).
# File lib/tidy/tidyopt.rb, line 13 def [](name) Tidylib.opt_get_value(@doc, name) end
[]=(name, value)
click to toggle source
Writer for options (Hash syntax).
# File lib/tidy/tidyopt.rb, line 19 def []=(name, value) Tidylib.opt_parse_value(@doc, name, value) end
method_missing(name, value=:none, *args)
click to toggle source
Reader/Writer for options (Object syntax).
# File lib/tidy/tidyopt.rb, line 25 def method_missing(name, value=:none, *args) name = name.to_s.gsub('=', '') return self[name] if value == :none self[name] = value end