Module: XMLable::Mixins::StandaloneElement
- Defined in:
- lib/xmlable/mixins/standalone_element.rb
Overview
StandaloneElement module contains standalone element’s logic
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
7 8 9 |
# File 'lib/xmlable/mixins/standalone_element.rb', line 7 def self.included(base) base.send(:extend, ClassMethods) end |
Instance Method Details
#initialize(node = nil, handler = nil) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/xmlable/mixins/standalone_element.rb', line 15 def initialize(node = nil, handler = nil) unless node doc = Nokogiri::XML::Document.new node = Nokogiri::XML::Element.new(self.class.__tag, doc) end handler = self.class.__standalone_element_handler unless handler super end |