Sha256: a76eb37d6d3cb40b645e992ec7d168312cc9a4903bceca3e065ce84564e4606c

Contents?: true

Size: 1.65 KB

Versions: 13

Compression:

Stored size: 1.65 KB

Contents

class OEHClient::Meta::Workspace < OEHClient::Data::Node
	extend OEHClient::Meta::Entity

	# set the ONE entity URI Stem for workspace requests
	self.entity_uri_stem 			= "workspaces"

	###
	### -------------  Constants
	###

	ONE_WORKSPACE_SITE_KEY			= "siteKey"


	###
	### -------------  Attributes
	###
					
	###
	### -------------  Class Methods
	###

	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 # def self.find_by_key


	###
	### -------------  Instance Methods
	###

	# retrieve the full collection of touchpoints from the curent workspace
	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

	# retrieve a single touchpoint from the current workspace based on the name
	def touchpoint(touchpoint_name)
		OEHClient::Meta::Touchpoint.create(self, OEHClient::Meta::Touchpoint.find_by_name(self.class.session, touchpoint_name, space: id))
	end 



end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
oeh-client-2.2.8 lib/oehclient/meta/workspace.rb
oeh-client-2.2.7 lib/oehclient/meta/workspace.rb
oeh-client-2.2.6 lib/oehclient/meta/workspace.rb
oeh-client-2.2.5 lib/oehclient/meta/workspace.rb
oeh-client-2.2.4 lib/oehclient/meta/workspace.rb
oeh-client-2.2.3 lib/oehclient/meta/workspace.rb
oeh-client-2.2.1 lib/oehclient/meta/workspace.rb
oeh-client-2.2.0 lib/oehclient/meta/workspace.rb
oeh-client-2.1.0 lib/oehclient/meta/workspace.rb
oeh-client-2.0.3 lib/oehclient/meta/workspace.rb
oeh-client-2.0.2 lib/oehclient/meta/workspace.rb
oeh-client-2.0.1 lib/oehclient/meta/workspace.rb
oeh-client-1.1.0 lib/oehclient/meta/workspace.rb