Class: OEHClient::Meta::Workspace

Inherits:
Data::Node show all
Extended by:
Entity
Defined in:
lib/oehclient/meta/workspace.rb

Constant Summary collapse

ONE_WORKSPACE_SITE_KEY =

————- Constants

"siteKey"

Constants included from Entity

Entity::ONE_PARAM_CREATED_BY, Entity::ONE_PARAM_CREATED_ON, Entity::ONE_PARAM_DATA, Entity::ONE_PARAM_ID, Entity::ONE_PARAM_ITEMS, Entity::ONE_PARAM_NAME, Entity::ONE_PARAM_SUCCESS

Instance Attribute Summary

Attributes inherited from Data::Node

#nodes

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Entity

create, entity_uri_stem, entity_uri_stem=, find_by_name, get, get_collection, session, session=

Methods inherited from Data::Node

#attribute_names, #initialize

Constructor Details

This class inherits a constructor from OEHClient::Data::Node

Class Method Details

.find_by_key(active_session, site_key, **args) ⇒ Object

————- Class Methods


22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/oehclient/meta/workspace.rb', line 22

def self.find_by_key(active_session, site_key, **args)
	# default the workspace instance NIL
	workspace_instance = nil
	# get the list of workspaces from the thinstance
	workspace_data = get(active_session, {:name => ONE_WORKSPACE_SITE_KEY, :value => site_key}, **args)
	unless (workspace_data.blank?)
		# convert the the workspace instance into a NEW instance of the OEHClient::Meta::Workspace instance
		workspace_instance = OEHClient::Meta::Workspace.new(workspace_data)
		# set the session object
	#	workspace_instance.session = session
		# return the workspace instance 
		workspace_instance
	end # unless workspace_data.blank?
end

Instance Method Details

#touchpoint(touchpoint_name) ⇒ Object

retrieve a single touchpoint from the current workspace based on the name


52
53
54
# File 'lib/oehclient/meta/workspace.rb', line 52

def touchpoint(touchpoint_name)
	OEHClient::Meta::Touchpoint.create(self, OEHClient::Meta::Touchpoint.find_by_name(self.class.session, touchpoint_name, space: id))
end

#touchpointsObject

retrieve the full collection of touchpoints from the curent workspace


43
44
45
46
47
48
49
# File 'lib/oehclient/meta/workspace.rb', line 43

def touchpoints()
	touchpoint_collection 	= Array.new
	OEHClient::Meta::Touchpoint.get_collection(self.class.session, space: id).each do | touchpoint_item |
		touchpoint_collection << OEHClient::Meta::Touchpoint.create(self, touchpoint_item)
	end
	touchpoint_collection
end