Class: Peanuts::Mappings::Content
- Inherits:
-
MemberMapping
- Object
- Peanuts::Mapping
- MemberMapping
- Peanuts::Mappings::Content
- Includes:
- ValueMapping
- Defined in:
- lib/peanuts/mappings.rb
Constant Summary collapse
- NODETYPES =
Set[:text, :significant_whitespace, :cdata].freeze
Instance Attribute Summary
Attributes inherited from MemberMapping
Attributes inherited from Peanuts::Mapping
#local_name, #namespace_uri, #options, #prefix
Instance Method Summary collapse
-
#initialize(name, type, options) ⇒ Content
constructor
A new instance of Content.
- #matches?(reader) ⇒ Boolean
Methods inherited from MemberMapping
#clear, #define_accessors, #read, #write
Methods inherited from Peanuts::Mapping
Constructor Details
#initialize(name, type, options) ⇒ Content
Returns a new instance of Content.
161 162 163 164 |
# File 'lib/peanuts/mappings.rb', line 161 def initialize(name, type, ) [:name] = '#text' super end |
Instance Method Details
#matches?(reader) ⇒ Boolean
166 167 168 |
# File 'lib/peanuts/mappings.rb', line 166 def matches?(reader) NODETYPES.include? reader.node_type end |