Sha256: c52ace6c68e68d8e54c48b965037268e14d4871f92ff47f139fd0c560318dde4

Contents?: true

Size: 575 Bytes

Versions: 4

Compression:

Stored size: 575 Bytes

Contents

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

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

p = Person.get_by_key "p6c75c02f-ed93-4ee8-9746-3603e915be23"

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

4 entries across 4 versions & 2 rubygems

Version Path
medea-0.2.29 lib/testjlp.rb
medea-0.2.28 lib/testjlp.rb
Medea-0.2.27 lib/testjlp.rb
Medea-0.2.26 lib/testjlp.rb