Sha256: 79b10ca14496d353c7b9d20a28891b41d5575211c4dbc9629fbdc2c0357adaea

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env ruby

$APP_PATH = File.dirname(__FILE__)
require 'lorj'

# If you want to see what is happening in the framework, uncomment debug settings.
# PrcLib.level = Logger::DEBUG # Printed out to your console.
# PrcLib.core_level = 3 # framework debug levels.

# Initialize the framework
hProcesses = [ File.join($APP_PATH, 'process', 'Students.rb')]

oStudentCore = Lorj::Core.new( nil, hProcesses, :mock)

# Ask the framework to create the object student 'Robert Redford'
oStudentCore.Create(:student, :student_name => "Robert Redford")

# Want to create a duplicated student 'Robert Redford'?
oStudentCore.Create(:student)
# no problem. The key is the key in the Mock controller array.

oStudentCore.Create(:student, :student_name => "Anthony Hopkins")

# Let's create a third different student.
oStudents = oStudentCore.Query(:student, { :name => "Robert Redford" } )

puts "%s students found" % oStudents.length

oStudents.each { | oStudent |
   puts "%s: %s" % [oStudent[:id], oStudent[:name]]
}

# let's check the get function, who is the ID 2?
oStudent = oStudentCore.Get(:student, 2)

puts "The student ID 2 is %s" % oStudent[:name]

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lorj-0.2.0 example/students_2/students.rb
lorj-0.1.0 example/students_2/students.rb