Module: Aqua::Pack::InstanceMethods
- Defined in:
- lib/aqua/object/pack.rb
Overview
ClassMethods
Instance Attribute Summary collapse
-
#_rev ⇒ Object
Returns the value of attribute _rev.
-
#_warnings ⇒ Object
Returns the value of attribute _warnings.
Instance Method Summary collapse
-
#_embedded? ⇒ true, false
private
Details from configuration options for the objects class about embedability.
-
#_pack ⇒ Storage
private
packs an object from it’s Ruby state into a Hash-like object for storage.
- #_pack_attachments ⇒ Object
-
#_stubbed_methods ⇒ true, ...
private
Details from configuration options for the objects class about embedability.
-
#_translator ⇒ Translator
private
Translator object responsible for packing the object and keeping track of externally stored records and also attachments.
-
#commit ⇒ Object
Saves object; returns false on failure; returns self on success.
-
#commit! ⇒ Object
Saves object and raises an error on failure.
Instance Attribute Details
#_rev ⇒ Object
Returns the value of attribute _rev.
135 136 137 |
# File 'lib/aqua/object/pack.rb', line 135 def _rev @_rev end |
#_warnings ⇒ Object
Returns the value of attribute _warnings.
135 136 137 |
# File 'lib/aqua/object/pack.rb', line 135 def _warnings @_warnings end |
Instance Method Details
#_embedded? ⇒ true, false
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Details from configuration options for the objects class about embedability.
131 132 133 |
# File 'lib/aqua/object/pack.rb', line 131 def self.class._aqua_opts[:embed] == true end |
#_pack ⇒ Storage
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
packs an object from it’s Ruby state into a Hash-like object for storage.
89 90 91 92 93 94 95 96 97 |
# File 'lib/aqua/object/pack.rb', line 89 def _pack class_name = self.class.to_s self.__pack = Storage.new self.__pack.id = @id if @id self.__pack[:_rev] = _rev if _rev self.__pack.merge!( _translator.pack_object( self ) ) __pack end |
#_pack_attachments ⇒ Object
99 100 101 102 103 |
# File 'lib/aqua/object/pack.rb', line 99 def _translator..each do |file| self.__pack..add( file.filename, file ) end end |
#_stubbed_methods ⇒ true, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Details from configuration options for the objects class about embedability.
121 122 123 124 |
# File 'lib/aqua/object/pack.rb', line 121 def _stubbed_methods meths = ! && self.class._aqua_opts[:embed] && self.class._aqua_opts[:embed][:stub] meths ? [meths].flatten : [] end |
#_translator ⇒ Translator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Translator object responsible for packing the object and keeping track of externally stored records and also attachments
110 111 112 |
# File 'lib/aqua/object/pack.rb', line 110 def _translator @_translator ||= Translator.new( self ) end |
#commit ⇒ Object
Saves object; returns false on failure; returns self on success.
76 77 78 |
# File 'lib/aqua/object/pack.rb', line 76 def commit _commit end |
#commit! ⇒ Object
Saves object and raises an error on failure
81 82 83 |
# File 'lib/aqua/object/pack.rb', line 81 def commit! _commit( false ) end |