Class: Atom::Entry
- Includes:
- HasCategories, HasLinks
- Defined in:
- lib/atom/entry.rb
Overview
An individual entry in a feed. As an Atom::Element, it can be manipulated using accessors for each of its child elements. You should be able to set them using an instance of any class that makes sense
Entries have the following children:
- id
-
a universally unique IRI which permanently identifies the entry
- title
-
a human-readable title (Atom::Text)
- content
-
contains or links to the content of an entry (Atom::Content)
- rights
-
information about rights held in and over an entry (Atom::Text)
- source
-
the source feed’s metadata (unimplemented)
- published
-
a Time “early in the life cycle of an entry”
- updated
-
the most recent Time an entry was modified in a way the publisher considers significant
- summary
-
a summary, abstract or excerpt of an entry (Atom::Text)
There are also categories
, links
, authors
and contributors
, each of which is an Array of its respective type and can be used thusly:
= entry..new :name => "Captain Kangaroo", :email => "[email protected]"
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
- #draft ⇒ Object (also: #draft?)
- #draft! ⇒ Object
- #draft=(is_draft) ⇒ Object
-
#inspect ⇒ Object
:nodoc:.
Methods included from HasLinks
Methods included from HasCategories
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::Element
Instance Method Details
#draft ⇒ Object Also known as: draft?
117 118 119 |
# File 'lib/atom/entry.rb', line 117 def draft control and control.draft end |
#draft! ⇒ Object
123 124 125 |
# File 'lib/atom/entry.rb', line 123 def draft! self.draft = true end |
#draft=(is_draft) ⇒ Object
127 128 129 130 131 132 |
# File 'lib/atom/entry.rb', line 127 def draft= is_draft unless control instance_variable_set '@control', Atom::Control.new end control.draft = is_draft end |
#inspect ⇒ Object
:nodoc:
113 114 115 |
# File 'lib/atom/entry.rb', line 113 def inspect # :nodoc: "#<Atom::Entry id:'#{self.id}'>" end |