Module: AwesomeXML::NativeType
Instance Method Summary collapse
-
#evaluate ⇒ Object
This method returns the parsed value of the given node (obtained by calling ‘#text` on it) according to the implementation of the private method `#parse_value` defined in every native type class.
-
#initialize(node, options = {}) ⇒ Object
Native type instances are initialized with a ‘Nokogiri::XML` object and an options hash.
Instance Method Details
#evaluate ⇒ Object
This method returns the parsed value of the given node (obtained by calling ‘#text` on it) according to the implementation of the private method `#parse_value` defined in every native type class.
18 19 20 |
# File 'lib/awesome_xml/native_type.rb', line 18 def evaluate @value ||= with_defaults { parse_value } end |
#initialize(node, options = {}) ⇒ Object
Native type instances are initialized with a ‘Nokogiri::XML` object and an options hash.
11 12 13 14 |
# File 'lib/awesome_xml/native_type.rb', line 11 def initialize(node, = {}) @string = node&.text @options = end |