Sha256: 04d076ea9fc59d5b3dbd80e1054ac23d06e8d0212997337dceae05a61c11c314

Contents?: true

Size: 603 Bytes

Versions: 10

Compression:

Stored size: 603 Bytes

Contents

# Ruby interface to Tidylib options.
#
class Tidyopt

  # Construct a new instance.
  #
  def initialize(doc)
    @doc = doc
  end
    
  # Reader for options (Hash syntax).
  #
  def [](name)
    Tidylib.opt_get_value(@doc, name)
  end
    
  # Writer for options (Hash syntax).
  #
  def []=(name, value)
    Tidylib.opt_parse_value(@doc, name, value)
  end
    
  # Reader/Writer for options (Object syntax).
  #
  def method_missing(name, value=:none, *args)
    name = name.to_s.gsub('=', '')
    return self[name] if value == :none
    self[name] = value
  end

end

Version data entries

10 entries across 10 versions & 6 rubygems

Version Path
adamcooper-tidy-1.2.0 lib/tidy/tidyopt.rb
pelle-tidy-1.1.4 lib/tidy/tidyopt.rb
terrbear-terrbear-tidy-1.1.4 lib/tidy/tidyopt.rb
terrbear-terrbear-tidy-1.1.5 lib/tidy/tidyopt.rb
terrbear-tidy-1.1.4 lib/tidy/tidyopt.rb
terrbear-tidy-1.1.5 lib/tidy/tidyopt.rb
tidy-fork-1.1.3 lib/tidy/tidyopt.rb
tidy-1.1.0 lib/tidy/tidyopt.rb
tidy-1.1.1 lib/tidy/tidyopt.rb
tidy-1.1.2 lib/tidy/tidyopt.rb