Class: OEHClient::Meta::Touchpoint
- Inherits:
-
Data::Node
- Object
- Data::Node
- OEHClient::Meta::Touchpoint
- Includes:
- WorkspaceEntity
- Defined in:
- lib/oehclient/meta/touchpoint.rb
Instance Attribute Summary
Attributes inherited from Data::Node
Class Method Summary collapse
-
.create(workspace, data) ⇒ Object
create a new instance of the class using the data set and assig the workspace.
Instance Method Summary collapse
-
#interaction(interaction_name) ⇒ Object
retrieve a single touchpoint from the current workspace based on the name.
-
#interactions ⇒ Object
retrieve the full collection of touchpoints from the curent workspace.
Methods included from WorkspaceEntity
Methods inherited from Data::Node
Constructor Details
This class inherits a constructor from OEHClient::Data::Node
Class Method Details
permalink .create(workspace, data) ⇒ Object
create a new instance of the class using the data set and assig the workspace
8 9 10 11 12 13 14 15 |
# File 'lib/oehclient/meta/touchpoint.rb', line 8 def self.create(workspace, data) # create from the past data structure touchpoint_instance = OEHClient::Meta::Touchpoint.new(data) # assign the local workspace object touchpoint_instance.workspace = workspace # return the instance touchpoint_instance end |
Instance Method Details
permalink #interaction(interaction_name) ⇒ Object
retrieve a single touchpoint from the current workspace based on the name
31 32 33 34 |
# File 'lib/oehclient/meta/touchpoint.rb', line 31 def interaction(interaction_name) # create and return the instance of an interaction based on the name, current workspace, and current touchpoint OEHClient::Meta::Interaction.create(workspace, OEHClient::Meta::Interaction.find_by_name(self.class.session, interaction_name, space: workspace.id, params: {:site => id})) end |
permalink #interactions ⇒ Object
retrieve the full collection of touchpoints from the curent workspace
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/oehclient/meta/touchpoint.rb', line 18 def interactions() # initialize the collection array interaction_collection = Array.new # retrieve the collection from ONE using the workspace reference and current touchpoint OEHClient::Meta::Interaction.get_collection(self.class.session, space: workspace.id, params: {:site => id}).each do | interaction_item | # create the instance of the interaction and add it to the collection interaction_collection << OEHClient::Meta::Interaction.create(workspace, interaction_item) end # return the collection to calling process interaction_collection end |