class GlueEnv
TODO: Have Persistent Layer GlueEnv
inherit from this GlueEnv
Or better see if it can follow the FilesMgr interface
move into its own file Also, put common code across glue envs here (can still be overwritten)
Attributes
_files_mgr_class[RW]
glue_interface[RW]
metadata_keys[RW]
moab_data[RW]
model_key[RW]
model_save_params[RW]
namespace_key[RW]
node_key[RW]
required_instance_keys[RW]
required_save_keys[RW]
user_datastore_location[RW]
user_id[RW]
version_key[RW]
views[RW]
Public Class Methods
new(glue_interface)
click to toggle source
# File lib/tinkit_base_node.rb, line 69 def initialize(glue_interface) #glue interface is the GlueEnv object for the persistence layer @glue_interface = glue_interface common_accessors = [ :user_id, :user_datastore_location, :metadata_keys, :required_instance_keys, :required_save_keys, :node_key, :model_key, :version_key, :namespace_key, :_files_mgr_class, :views, :model_save_params, :moab_data ] common_accessors.each do |acc_sym| accessor = "@#{acc_sym.to_s}".to_sym accessor_value = @glue_interface.__send__(acc_sym) self.instance_variable_set(accessor, accessor_value) end end
Public Instance Methods
destroy_bulk(list_of_native_records)
click to toggle source
common methods
# File lib/tinkit_base_node.rb, line 83 def destroy_bulk(list_of_native_records) @glue_interface.destroy_bulk(list_of_native_records) end
destroy_node(model_metadata)
click to toggle source
# File lib/tinkit_base_node.rb, line 87 def destroy_node(model_metadata) @glue_interface.destroy_node(model_metadata) end
generate_model_key(namespace, node_key)
click to toggle source
# File lib/tinkit_base_node.rb, line 91 def generate_model_key(namespace, node_key) #so far the model key is "#{namespace}::#{node_key}" in all persitence models @glue_interface.generate_model_key(namespace, node_key) end
get(id)
click to toggle source
# File lib/tinkit_base_node.rb, line 96 def get(id) @glue_interface.get(id) end
method_missing(name)
click to toggle source
# File lib/tinkit_base_node.rb, line 62 def method_missing(name) #resp = @glue_interface.__send__(name) raise NameError,"Method #{name} was not found in #{self.class.name}. Has it been"\ " built into the persistent model interface yet?" #resp end
query_all()
click to toggle source
# File lib/tinkit_base_node.rb, line 100 def query_all @glue_interface.query_all end
raw_all()
click to toggle source
# File lib/tinkit_base_node.rb, line 104 def raw_all @glue_interface.raw_all end
save(new_data)
click to toggle source
# File lib/tinkit_base_node.rb, line 108 def save(new_data) @glue_interface.save(new_data) end