Query Users

To query User, you use Lafcadio's query inference.

require 'tutorial_setup'

does = User.get { |u| u.last_name.equals( 'Doe' ) }
puts "There are #{ does.size } user(s) with the last name 'Doe'."
jane_does = User.get { |u|
  Lafcadio::Query.And(
    u.first_name.equals( 'Jane' ), u.last_name.equals( 'Doe' )
  )
}
puts "There are #{ jane_does.size } user(s) with the first name 'Jane' and the last name 'Doe'."
messages_to_jane = Message.get { |m| m.recipient.equals( jane_does.first ) }
puts "There are #{ messages_to_jane.size } message(s) to Jane Doe."