Sha256: 5f4c03826906ffd38255ca50e11690d524b562340de6d620d62cf52da0f7e6a6

Contents?: true

Size: 594 Bytes

Versions: 2

Compression:

Stored size: 594 Bytes

Contents

$: << "~/Projects/Medea/lib"
require 'rubygems'
require 'medea'

class Person < Medea::JasonObject
  has_many :followees, Person
end

p = Person.get_by_key "pa76b65a2-ba64-4cf0-8b37-7ad6a30ee8db"

puts p.followees.to_url
puts p.followees.count

puts "Let's make a new person!"

p1 = Person.new
puts "Name?"
p1.name = gets.strip
if p1.name != ""
  puts "Saving..."
  p1.save!

  puts "Making #{p.name} follow #{p1.name}..."
  p.followees.add! p1
end
puts "Done!"
list = p.followees
puts "#{p.name} now following #{list.count} users:"
list.each do |f|
  puts " - #{f.jason_key}: #{f.name}\n"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
medea-0.2.31 lib/testjlp.rb
medea-0.2.30 lib/testjlp.rb