Class: Intersys::Reflection::RelationshipObject

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/intersys.rb

Overview

This is a proxy object to Cache RelationshipObject, which is just like Rails Association object

Instance Method Summary collapse

Methods inherited from Object

#class_name, class_name, common_get_or_set, concurrency, #database, database, delete_all, #destroy, #id, inherited, intersys_description, lookup, prefix, timeout, transaction

Methods included from Callable

#intersys_call, #intersys_get, #intersys_has_method?, #intersys_has_property?, #intersys_method, #intersys_methods, #intersys_properties, #intersys_property, #intersys_reflector, #intersys_set, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Intersys::Callable

Instance Method Details

#<<(object) ⇒ Object Also known as: insert



409
410
411
# File 'lib/intersys.rb', line 409

def <<(object)
  intersys_call("Insert", object)
end

#[](index) ⇒ Object



383
384
385
386
# File 'lib/intersys.rb', line 383

def [](index)
  return @list[index] if @loaded
  intersys_call("GetAt", index.to_s)
end

#countObject Also known as: size



378
379
380
# File 'lib/intersys.rb', line 378

def count
  @count ||= intersys_call("Count")
end

#eachObject



388
389
390
391
392
# File 'lib/intersys.rb', line 388

def each
  1.upto(count) do |i|
    yield self[i]
  end
end

#empty?Boolean

Returns:

  • (Boolean)


374
375
376
# File 'lib/intersys.rb', line 374

def empty?
  @empty ||= intersys_call("IsEmpty")
end

#include?(obj) ⇒ Boolean

Returns:

  • (Boolean)


400
401
402
# File 'lib/intersys.rb', line 400

def include?(obj)
  load_list.include?(obj)
end

#inspectObject Also known as: to_s



404
405
406
# File 'lib/intersys.rb', line 404

def inspect
  load_list.inspect
end

#reloadObject



414
415
416
417
418
419
# File 'lib/intersys.rb', line 414

def reload
  @list = nil
  @loaded = nil
  @empty = nil
  @count = nil
end

#to_aObject



396
397
398
# File 'lib/intersys.rb', line 396

def to_a
  load_list
end