Module: AwesomeXML::NativeType
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
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(string, options) ⇒ Object
Native type instances are initialized with a ‘Nokogiri::XML` object and an options hash.
Class Method Details
.included(base) ⇒ Object
7 8 9 10 11 |
# File 'lib/awesome_xml/native_type.rb', line 7 def self.included(base) base.class_eval do base.extend(AwesomeXML::NativeType::ClassMethods) end end |
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.
24 25 26 |
# File 'lib/awesome_xml/native_type.rb', line 24 def evaluate @value ||= with_defaults { parse_value } end |
#initialize(string, options) ⇒ Object
Native type instances are initialized with a ‘Nokogiri::XML` object and an options hash.
17 18 19 20 |
# File 'lib/awesome_xml/native_type.rb', line 17 def initialize(string, ) @string = string @options = end |