Class: Atom::Content

Inherits:
Text show all
Defined in:
lib/atom/text.rb

Overview

Atom::Content behaves the same as an Atom::Text, but for two things:

  • the “type” attribute can be an arbitrary media type

  • there is a “src” attribute which is an IRI that points to the content of the entry (in which case the content element will be empty)

Instance Attribute Summary

Attributes inherited from Element

#base, #extensions

Instance Method Summary collapse

Methods inherited from Text

#html, #initialize, #inspect, #to_s, #type, #type=, #xml

Methods included from AttrEl

#[], #[]=

Methods inherited from Element

#append_elem, attributes, #build, builders, def_get, def_set, do_parsing, #get, #get_atom_attrb, #get_atom_elem, #get_atom_elems, #get_elem, #get_elems, #initialize, initters, is_atom_element, is_element, on_build, on_init, parse, #set, #set_atom_attrb, #to_s, #to_xml

Methods included from Parsers

#on_parse, #on_parse_attr, #on_parse_many, #on_parse_root, #parse_plain

Methods included from Converters

#atom_attrb, #atom_element, #atom_elements, #atom_link, #atom_string, #atom_time, #attrb, #build_plain, #element, #elements, #strings, #time

Constructor Details

This class inherits a constructor from Atom::Text

Instance Method Details

#src=(v) ⇒ Object



197
198
199
200
201
202
203
204
205
# File 'lib/atom/text.rb', line 197

def src= v
  @content = nil

  if self.base
    @src = (self.base.to_uri + v).to_s
  else
    @src = v
  end
end