Home » Ruby-2.3.8 » rss » Index (C) » RSS » Maker » Atom » Feed » Items » Item » Content ▲
123456789_123456789_123456789_123456789_123456789_

Class: RSS::Maker::Atom::Feed::Items::Item::Content

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ContentBase
Instance Chain:
self, ContentBase
Inherits: ContentBase
  • Object
Defined in: lib/rss/maker/feed.rb

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#xml_type?Boolean (readonly, private)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 404

def xml_type?
  _type = type
  return false if _type.nil?
  _type == "xhtml" or
    /(?:\+xml|\/xml)$/i =~ _type or
    %w(text/xml-external-parsed-entity
       application/xml-external-parsed-entity
       application/xml-dtd).include?(_type.downcase)
end

Instance Method Details

#required_variable_names (private)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 384

def required_variable_names
  if out_of_line?
    %w(type)
  elsif xml_type?
    %w(xml_content)
  else
    %w(content)
  end
end

#to_feed(feed, current)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 368

def to_feed(feed, current)
  content = current.class::Content.new
  if setup_values(content)
    content.src = nil if content.src and content.content
    current.content = content
    set_parent(content, current)
    setup_other_elements(feed, content)
  elsif variable_is_set?
    raise NotSetError.new("maker.item.content",
                          not_set_required_variables)
  end
end

#variables (private)

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 394

def variables
  if out_of_line?
    super
  elsif xml_type?
    super + %w(xml)
  else
    super
  end
end

#xml

[ GitHub ]

  
# File 'lib/rss/maker/feed.rb', line 381

alias_method(:xml, :xml_content)