Sha256: c20b807ca962573b5921103231373f6f57296fb88ea3664651f85e42cf0062a1

Contents?: true

Size: 1.6 KB

Versions: 21

Compression:

Stored size: 1.6 KB

Contents

class <%=class_name%> < Rhoconnect::Model::Base
  def initialize(source) 
    super(source)
  end
 
  def login
    # TODO: Login to your data source here if necessary
  end
 
  def query(params=nil)
    # TODO: Query your backend data source and assign the records 
    # to a nested hash structure called @result. For example:
    # @result = { 
    #   "1"=>{"name"=>"Acme", "industry"=>"Electronics"},
    #   "2"=>{"name"=>"Best", "industry"=>"Software"}
    # }
    raise Rhoconnect::Model::Exception.new("Please provide some code to read records from the backend data source")
  end

  def create(create_hash)
    # TODO: Create a new record in your backend data source
    raise "Please provide some code to create a single record in the backend data source using the create_hash"
  end
 
  def update(update_hash)
    # TODO: Update an existing record in your backend data source
    raise "Please provide some code to update a single record in the backend data source using the update_hash"
  end
 
  def delete(delete_hash)
    # TODO: write some code here if applicable
    # be sure to have a hash key and value for "object"
    # for now, we'll say that its OK to not have a delete operation
    # raise "Please provide some code to delete a single object in the backend application using the object_id"
  end
 
  def logoff
    # TODO: Logout from the data source if necessary
  end

  def store_blob(object,field_name,blob)
    # TODO: Handle post requests for blobs here.
    # make sure you store the blob object somewhere permanently
    raise "Please provide some code to handle blobs if you are using them."
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 generators/templates/source/models/ruby/model.rb
rhoconnect-7.5.1 generators/templates/source/models/ruby/model.rb
rhoconnect-7.4.1 generators/templates/source/models/ruby/model.rb
rhoconnect-7.1.17 generators/templates/source/models/ruby/model.rb
rhoconnect-6.2.0 generators/templates/source/models/ruby/model.rb
rhoconnect-6.0.11 generators/templates/source/models/ruby/model.rb
rhoconnect-5.5.18 generators/templates/source/models/ruby/model.rb
rhoconnect-5.5.17 generators/templates/source/models/ruby/model.rb
rhoconnect-5.5.15 generators/templates/source/models/ruby/model.rb
rhoconnect-5.5.0.22 generators/templates/source/models/ruby/model.rb
rhoconnect-5.5.2 generators/templates/source/models/ruby/model.rb
rhoconnect-5.5.0.7 generators/templates/source/models/ruby/model.rb
rhoconnect-5.5.0.3 generators/templates/source/models/ruby/model.rb
rhoconnect-5.5.0 generators/templates/source/models/ruby/model.rb
rhoconnect-5.1.1 generators/templates/source/models/ruby/model.rb
rhoconnect-4.0.4 generators/templates/source/models/ruby/model.rb
rhoconnect-4.0.3 generators/templates/source/models/ruby/model.rb
rhoconnect-4.0.2 generators/templates/source/models/ruby/model.rb
rhoconnect-4.0.1 generators/templates/source/models/ruby/model.rb
rhoconnect-4.0.0 generators/templates/source/models/ruby/model.rb