Class: Peanuts::Mappings::Content

Inherits:
MemberMapping show all
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

#converter, #name, #type

Attributes inherited from Peanuts::Mapping

#local_name, #namespace_uri, #options, #prefix

Instance Method Summary collapse

Methods inherited from MemberMapping

#clear, #define_accessors, #read, #write

Methods inherited from Peanuts::Mapping

node_type

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, options)
  options[:name] = '#text'
  super
end

Instance Method Details

#matches?(reader) ⇒ Boolean

Returns:

  • (Boolean)


166
167
168
# File 'lib/peanuts/mappings.rb', line 166

def matches?(reader)
  NODETYPES.include? reader.node_type
end