Class: Atom::Entry
- Includes:
- HasCategories, HasLinks
- Defined in:
- lib/atom/feed.rb,
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, is_atom_element, is_element, on_build, on_init, parse, run_initters, #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?
92 93 94 |
# File 'lib/atom/entry.rb', line 92 def draft control and control.draft end |
#draft! ⇒ Object
98 99 100 |
# File 'lib/atom/entry.rb', line 98 def draft! self.draft = true end |
#draft=(is_draft) ⇒ Object
102 103 104 105 106 107 |
# File 'lib/atom/entry.rb', line 102 def draft= is_draft unless control instance_variable_set '@control', Atom::Control.new end control.draft = is_draft end |
#inspect ⇒ Object
:nodoc:
88 89 90 |
# File 'lib/atom/entry.rb', line 88 def inspect # :nodoc: "#<Atom::Entry id:'#{self.id}'>" end |