Sha256: 37c00226ecaf74390232934bc97df49a8a8991c7ccdfa3a18895c8b8229fc6e8

Contents?: true

Size: 1.93 KB

Versions: 31

Compression:

Stored size: 1.93 KB

Contents

# encoding: UTF-8

# (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

# Students process
class StudentsProcess
  def create_student(sObjectType, hParams)
    PrcLib.state(format("Running creation process for object '%s' = '%s'",
                        sObjectType, hParams[:student_name]))
    #  byebug if ENV['BYEBUG'] # rubocop: disable Debugger
    object = controller_create(sObjectType)
    PrcLib.runtime_fail "Student '%s' not created.",
                        hParams[:student_name] if object.nil?
    PrcLib.info("'%s': '%s' created with id %s",
                sObjectType, hParams[:student_name], object[:id])
    object
  end
end

# Declaring your data model and handlers.
class Lorj::BaseDefinition # rubocop: disable Style/ClassAndModuleChildren
  # We need to define the student object and the handler to use while we need to
  # create it.
  define_obj(:student,
             # The function to call in the class Students
             :create_e => :create_student,
             # We use predefined call to the controller query
             :query_e => :controller_query,
             # We use predefined call to the controller get
             :get_e => :controller_get,
             # We use predefined call to the controller delete
             :delete_e => :controller_delete
            )

  obj_needs :data, :student_name, :for => [:create_e], :mapping => :name
end

Version data entries

31 entries across 10 versions & 1 rubygems

Version Path
lorj-1.0.20 example/students_3/process/students.rb
lorj-1.0.20 lorj-spec/process/mock2_process.rb
lorj-1.0.20 example/students_2/process/students.rb
lorj-1.0.19 example/students_2/process/students.rb
lorj-1.0.19 lorj-spec/process/mock2_process.rb
lorj-1.0.19 example/students_3/process/students.rb
lorj-1.0.18 lorj-spec/process/mock2_process.rb
lorj-1.0.18 example/students_3/process/students.rb
lorj-1.0.18 example/students_2/process/students.rb
lorj-1.0.17 lorj-spec/process/mock2_process.rb
lorj-1.0.17 example/students_3/process/students.rb
lorj-1.0.17 example/students_2/process/students.rb
lorj-1.0.16 example/students_2/process/students.rb
lorj-1.0.16 lorj-spec/process/mock2_process.rb
lorj-1.0.16 example/students_3/process/students.rb
lorj-1.0.14 lorj-spec/process/mock2_process.rb
lorj-1.0.14 example/students_2/process/students.rb
lorj-1.0.14 example/students_3/process/students.rb
lorj-1.0.13 lorj-spec/process/mock2_process.rb
lorj-1.0.13 example/students_3/process/students.rb