Class: Aqua::FileStub

Inherits:
Stub
  • Object
show all
Defined in:
lib/aqua/object/stub.rb

Instance Attribute Summary collapse

Attributes inherited from Stub

#delegate, #delegate_class, #delegate_id, #parent_object, #path_from_parent

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ FileStub

Returns a new instance of FileStub.



63
64
65
66
67
68
# File 'lib/aqua/object/stub.rb', line 63

def initialize( opts )
  super( opts ) 
  self.base_class = opts[:base_object].class
  self.base_id =    opts[:base_id]
  self.attachment_id = opts[:id]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Aqua::Stub

Instance Attribute Details

#attachment_idObject

Returns the value of attribute attachment_id.



61
62
63
# File 'lib/aqua/object/stub.rb', line 61

def attachment_id
  @attachment_id
end

#base_classObject

Returns the value of attribute base_class.



61
62
63
# File 'lib/aqua/object/stub.rb', line 61

def base_class
  @base_class
end

#base_idObject

Returns the value of attribute base_id.



61
62
63
# File 'lib/aqua/object/stub.rb', line 61

def base_id
  @base_id
end

Class Method Details

.aqua_init(init, opts) ⇒ Object

This is what is actually called in the Aqua unpack process



71
72
73
74
75
# File 'lib/aqua/object/stub.rb', line 71

def self.aqua_init( init, opts )
  init['base_object'] = opts.base_object
  init['base_id'] = opts.base_id || opts.base_object.id # this is needed when an object is loaded, not reloaded
  super
end