Class RSS::Maker::Atom::Feed::Items::Item::Content
In: lib/rss/maker/feed.rb
Parent: ContentBase

Methods

External Aliases

xml_content -> xml

Public Instance methods

[Source]

     # File lib/rss/maker/feed.rb, line 370
370:               def to_feed(feed, current)
371:                 content = current.class::Content.new
372:                 if setup_values(content)
373:                   content.src = nil if content.src and content.content
374:                   current.content = content
375:                   set_parent(content, current)
376:                   setup_other_elements(feed, content)
377:                 elsif variable_is_set?
378:                   raise NotSetError.new("maker.item.content",
379:                                         not_set_required_variables)
380:                 end
381:               end

Private Instance methods

[Source]

     # File lib/rss/maker/feed.rb, line 386
386:               def required_variable_names
387:                 if out_of_line?
388:                   %w(type)
389:                 elsif xml_type?
390:                   %w(xml_content)
391:                 else
392:                   %w(content)
393:                 end
394:               end

[Source]

     # File lib/rss/maker/feed.rb, line 396
396:               def variables
397:                 if out_of_line?
398:                   super
399:                 elsif xml_type?
400:                   super + %w(xml)
401:                 else
402:                   super
403:                 end
404:               end

[Source]

     # File lib/rss/maker/feed.rb, line 406
406:               def xml_type?
407:                 _type = type
408:                 return false if _type.nil?
409:                 _type == "xhtml" or
410:                   /(?:\+xml|\/xml)$/i =~ _type or
411:                   %w(text/xml-external-parsed-entity
412:                      application/xml-external-parsed-entity
413:                      application/xml-dtd).include?(_type.downcase)
414:               end

[Validate]