Module RSS::Atom::TextConstruct
In: lib/rss/atom.rb

Methods

Attributes

xhtml  [W] 

Public Class methods

[Source]

     # File lib/rss/atom.rb, line 79
 79:       def self.append_features(klass)
 80:         super
 81:         klass.class_eval do
 82:           [
 83:            ["type", ""],
 84:           ].each do |name, uri, required|
 85:             install_get_attribute(name, uri, required, :text_type)
 86:           end
 87: 
 88:           content_setup
 89:           add_need_initialize_variable("xhtml")
 90: 
 91:           class << self
 92:             def xml_getter
 93:               "xhtml"
 94:             end
 95: 
 96:             def xml_setter
 97:               "xhtml="
 98:             end
 99:           end
100:         end
101:       end

[Source]

    # File lib/rss/atom.rb, line 92
92:             def xml_getter
93:               "xhtml"
94:             end

[Source]

    # File lib/rss/atom.rb, line 96
96:             def xml_setter
97:               "xhtml="
98:             end

Public Instance methods

[Source]

     # File lib/rss/atom.rb, line 121
121:       def atom_validate(ignore_unknown_element, tags, uri)
122:         if have_xml_content?
123:           if @xhtml.nil?
124:             raise MissingTagError.new("div", tag_name)
125:           end
126:           unless [@xhtml.name, @xhtml.uri] == ["div", XHTML_URI]
127:             raise NotExpectedTagError.new(@xhtml.name, @xhtml.uri, tag_name)
128:           end
129:         end
130:       end

[Source]

     # File lib/rss/atom.rb, line 117
117:       def have_xml_content?
118:         @type == "xhtml"
119:       end

[Source]

     # File lib/rss/atom.rb, line 104
104:       def xhtml
105:         return @xhtml if @xhtml.nil?
106:         if @xhtml.is_a?(XML::Element) and
107:             [@xhtml.name, @xhtml.uri] == ["div", XHTML_URI]
108:           return @xhtml
109:         end
110: 
111:         children = @xhtml
112:         children = [children] unless children.is_a?(Array)
113:         XML::Element.new("div", nil, XHTML_URI,
114:                          {"xmlns" => XHTML_URI}, children)
115:       end

Private Instance methods

[Source]

     # File lib/rss/atom.rb, line 133
133:       def maker_target(target)
134:         target.__send__(self.class.name.split(/::/).last.downcase) {|x| x}
135:       end

[Source]

     # File lib/rss/atom.rb, line 137
137:       def setup_maker_attributes(target)
138:         target.type = type
139:         target.content = content
140:         target.xml_content = @xhtml
141:       end

[Validate]