Class: ODDB::Persistence::CreateItem

Inherits:
Object
  • Object
show all
Defined in:
src/util/persistence.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (CreateItem) initialize(pointer = Pointer.new)

A new instance of CreateItem



353
354
355
356
357
# File 'src/util/persistence.rb', line 353

def initialize(pointer=Pointer.new)
  @inner_pointer = pointer
  @pointer = Pointer.new([:create, pointer])
  @data = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(key, *args)



367
368
369
# File 'src/util/persistence.rb', line 367

def method_missing(key, *args)
  @data[key]
end

Instance Attribute Details

- (Object) inner_pointer (readonly)

Returns the value of attribute inner_pointer



352
353
354
# File 'src/util/persistence.rb', line 352

def inner_pointer
  @inner_pointer
end

- (Object) pointer (readonly)

Returns the value of attribute pointer



352
353
354
# File 'src/util/persistence.rb', line 352

def pointer
  @pointer
end

Instance Method Details

- (Object) append(val)



361
362
363
# File 'src/util/persistence.rb', line 361

def append(val)
  @inner_pointer.append(val)
end

- (Object) carry(key, val = nil)



364
365
366
# File 'src/util/persistence.rb', line 364

def carry(key, val=nil)
  @data.store(key.to_s.to_sym, val)
end

- (Object) parent(app)



370
371
372
# File 'src/util/persistence.rb', line 370

def parent(app)
  @inner_pointer.parent.resolve(app)
end

- (Boolean) respond_to?(key)

Returns:

  • (Boolean)


373
374
375
# File 'src/util/persistence.rb', line 373

def respond_to?(key)
  key != :pointer_descr
end

- (Object) structural_ancestors(app)



358
359
360
# File 'src/util/persistence.rb', line 358

def structural_ancestors(app)
  @inner_pointer.ancestors.collect { |pointer| pointer.resolve(app) }
end