Class: Exlibris::Primo::Tags
- Inherits:
-
Object
- Object
- Exlibris::Primo::Tags
- Includes:
- ChainGang::Base, ChainGang::Record, ChainGang::User, Config::Attributes, RequestAttributes, WriteAttributes
- Defined in:
- lib/exlibris/primo/tags.rb
Overview
Instance Attribute Summary collapse
-
#record_id ⇒ Object
readonly
Returns the value of attribute record_id.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#add_tag(tag) ⇒ Object
Call web service to add a tag to Primo for the specified record.
-
#add_tags(tags) ⇒ Object
Call web service to add tags to Primo for the specified record.
-
#initialize(*args) ⇒ Tags
constructor
A new instance of Tags.
-
#record_tags ⇒ Object
Get all tags for the specified user.
-
#remove_tag(tag) ⇒ Object
Call web service to remove tag from Primo for the specified record.
-
#remove_tags(tags) ⇒ Object
Call web service to remove tags from Primo for the specified record.
-
#remove_user_tags ⇒ Object
Remove all users tags.
-
#tags ⇒ Object
Get tags for the specified user and record.
-
#user_tags ⇒ Object
Get all tags for the specified user.
Methods included from WriteAttributes
Methods included from ChainGang::Record
Methods included from ChainGang::User
Methods included from ChainGang::Base
#base_url!, #group!, #institution!, #ip!, #logged_in, #logged_out, #off_campus, #on_campus, #pds_handle!
Methods included from Config::Attributes
#availability_statuses, #base_url, #config, #facet_collections, #facet_labels, #facet_resource_types, #facet_top_level, #institution, #institutions, #libraries, #sources
Constructor Details
#initialize(*args) ⇒ Tags
Returns a new instance of Tags.
20 21 22 |
# File 'lib/exlibris/primo/tags.rb', line 20 def initialize *args super end |
Instance Attribute Details
#record_id ⇒ Object (readonly)
Returns the value of attribute record_id.
18 19 20 |
# File 'lib/exlibris/primo/tags.rb', line 18 def record_id @record_id end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
18 19 20 |
# File 'lib/exlibris/primo/tags.rb', line 18 def user_id @user_id end |
Instance Method Details
#add_tag(tag) ⇒ Object
Call web service to add a tag to Primo for the specified record
58 59 60 61 |
# File 'lib/exlibris/primo/tags.rb', line 58 def add_tag(tag) Exlibris::Primo::WebService::Request::AddTag.new(user_record_request_attributes.merge :value => tag).call end |
#add_tags(tags) ⇒ Object
Call web service to add tags to Primo for the specified record
49 50 51 52 53 |
# File 'lib/exlibris/primo/tags.rb', line 49 def () .each do |tag| add_tag tag end end |
#record_tags ⇒ Object
Get all tags for the specified user
34 35 36 |
# File 'lib/exlibris/primo/tags.rb', line 34 def @record_tags ||= . end |
#remove_tag(tag) ⇒ Object
Call web service to remove tag from Primo for the specified record
75 76 77 78 |
# File 'lib/exlibris/primo/tags.rb', line 75 def remove_tag(tag) Exlibris::Primo::WebService::Request::RemoveTag.new(user_record_request_attributes.merge :value => tag).call end |
#remove_tags(tags) ⇒ Object
Call web service to remove tags from Primo for the specified record
66 67 68 69 70 |
# File 'lib/exlibris/primo/tags.rb', line 66 def () .each do |tag| remove_tag tag end end |
#remove_user_tags ⇒ Object
Remove all users tags
83 84 85 86 |
# File 'lib/exlibris/primo/tags.rb', line 83 def Exlibris::Primo::WebService::Request::RemoveUserTags.new(user_request_attributes).call end |
#tags ⇒ Object
Get tags for the specified user and record
27 28 29 |
# File 'lib/exlibris/primo/tags.rb', line 27 def @tags ||= . end |
#user_tags ⇒ Object
Get all tags for the specified user
41 42 43 44 |
# File 'lib/exlibris/primo/tags.rb', line 41 def @user_tags ||= Exlibris::Primo::WebService::Request::GetAllMyTags.new(user_request_attributes).call. end |