Class: AIXM::Feature::Generic
- Inherits:
-
AIXM::Feature
- Object
- Component
- AIXM::Feature
- AIXM::Feature::Generic
- Defined in:
- lib/aixm/feature/generic.rb
Overview
Generic feature represented as XML document fragment.
Cheat Sheet in Pseudo Code:
generic = AIXM.generic(
fragment: Nokogiri::XML::DocumentFragment or String
)
Constant Summary
Constants inherited from AIXM::Feature
Instance Attribute Summary collapse
-
#fragment ⇒ Object
XML document fragment.
Attributes inherited from AIXM::Feature
Attributes inherited from Component
Instance Method Summary collapse
-
#initialize(source: nil, region: nil, fragment:) ⇒ Generic
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
-
#to_uid ⇒ Integer
Pseudo UID fragment.
Methods inherited from AIXM::Feature
Methods included from Concerns::HashEquality
Methods included from Concerns::XMLBuilder
Methods included from Concerns::Memoize
Constructor Details
#initialize(source: nil, region: nil, fragment:) ⇒ Generic
See the cheat sheet for examples on how to create instances of this class.
26 27 28 29 |
# File 'lib/aixm/feature/generic.rb', line 26 def initialize(source: nil, region: nil, fragment:) super(source: source, region: region) self.fragment = fragment end |
Instance Attribute Details
#fragment ⇒ Nokogiri::XML::DocumentFragment #fragment=(value) ⇒ Object
XML document fragment
22 23 24 |
# File 'lib/aixm/feature/generic.rb', line 22 def fragment @fragment end |
Instance Method Details
#inspect ⇒ String
32 33 34 |
# File 'lib/aixm/feature/generic.rb', line 32 def inspect %Q(#<#{self.class} #{fragment.elements.first.name}>) end |
#to_uid ⇒ Integer
Returns pseudo UID fragment.
44 45 46 |
# File 'lib/aixm/feature/generic.rb', line 44 def to_uid fragment.to_xml.hash end |