rAtom and Atom::Generation

S

sutch

I'm attempting to produce an atom feed using rAtom and have run into
one issue with Atom::Generator. The docs are not real clear. I have
created a new generator using:

feed.generator = Atom::Generator.new({:version => "0.1"})

This produces:

<generator version="0.1"/>

There does not seem to be a method for setting the contents of the
generator. What I want output is something along the lines of:

<generator version="0.1">My Generator</generator>

Anyone know how this might be accomplished?
 
M

Mark Thomas

I'm attempting to produce an atom feed using rAtom and have run into
one issue with Atom::Generator.  The docs are not real clear.  I have
created a new generator using:

  feed.generator = Atom::Generator.new({:version => "0.1"})

This produces:

  <generator version="0.1"/>

There does not seem to be a method for setting the contents of the
generator.  What I want output is something along the lines of:

  <generator version="0.1">My Generator</generator>

Anyone know how this might be accomplished?

See the README file for rAtom (http://ratom.rubyforge.org)

You use a construct like:

feed = Atom::Feed.new do |f|
..
end
puts feed.to_xml

I don't think you use Atom::Generator directly.

-- Mark.
 
T

Tyler Amos

I had this same problem. After some playing around (since the rAtom
documentation wasn't too helpful here), I was able to get it by doing
the following:

f.generator = Atom::Generator.new:)version => '1.0') do |s|
s.name = "My Generator"
end

I doubt you still need the help, but maybe this will help someone else!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top