On Sat, Dec 15, 2001 at 07:52:30AM -0500, Vincent Stoessel wrote:
> ># Create connection to Midgard database
> >mgd = Midgard::Core.new(username, password)
> >
> >article = mgd.make(:Article, 1) # creates an object which points to
> > # article with id = 1
> >
> >puts article.guid # displays GUID of article
> >
> >article.get # fetches whole object of database
> >
> ># Count number of lines in the article
> >number_of_lines = 0
> >article['content'].each {|line| number_of_lines = number_of_lines + 1}
> >
> ># Print article title and number of lines of its content
> >puts "Article '#{article['title']}' is #{number_of_lines} line(s) long"
> wow, this looks cool . Is this Ruby or C?
Pure Ruby. Fully working example is in
CVS:/midgard/scriptor/examples/article-content.rb now.
--
/ Alexander Bokovoy
$ cat /proc/identity >~/.signature
`Senior software developer and analyst for SaM-Solutions Ltd.`
---
Nov 21 20:58:58 alconost kernel: VFS: Busy inodes after unmount.
Self-destruct in 5 seconds. Have a nice day...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]