Module: AwesomeXML::NativeType

Included in:
DateTime, Duration, Float, Integer, Text
Defined in:
lib/awesome_xml/native_type.rb

Instance Method Summary collapse

Instance Method Details

#evaluateObject

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, options = {})
  @string = node&.text
  @options = options
end