Class: Saxon::ParserProperties
- Inherits:
-
Object
- Object
- Saxon::ParserProperties
- Includes:
- Enumerable
- Defined in:
- lib/saxon/parse_options.rb
Overview
Provides idiomatic access to parser properties
Instance Method Summary collapse
-
#[](uri) ⇒ Object
Fetch the current value of a Parser Property.
-
#[]=(uri, value) ⇒ Object
Set the value of a Parser Property.
-
#each {|uri, value| ... } ⇒ Object
Iterate across each currently-set property, in the same way as a hash.
-
#initialize(parse_options) ⇒ ParserProperties
constructor
private
A new instance of ParserProperties.
-
#to_h ⇒ Hash
The currently-set properties as a (frozen) hash.
Constructor Details
#initialize(parse_options) ⇒ ParserProperties
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ParserProperties.
40 41 42 |
# File 'lib/saxon/parse_options.rb', line 40 def initialize() @parse_options ||= end |
Instance Method Details
#[](uri) ⇒ Object
Fetch the current value of a Parser Property
53 54 55 56 |
# File 'lib/saxon/parse_options.rb', line 53 def [](uri) return nil if .getParserProperties.nil? .getParserProperty(uri) end |
#[]=(uri, value) ⇒ Object
Set the value of a Parser Property
63 64 65 66 |
# File 'lib/saxon/parse_options.rb', line 63 def []=(uri, value) .addParserProperties(uri, value) self[uri] end |
#each {|uri, value| ... } ⇒ Object
Iterate across each currently-set property, in the same way as a hash
73 74 75 |
# File 'lib/saxon/parse_options.rb', line 73 def each(&block) to_h.each(&block) end |
#to_h ⇒ Hash
Returns the currently-set properties as a (frozen) hash.
45 46 47 |
# File 'lib/saxon/parse_options.rb', line 45 def to_h (.getParserProperties || {}).freeze end |