Class: Exlibris::Primo::Review

Inherits:
Object
  • Object
show all
Includes:
Config::Attributes, Namespaces, WriteAttributes, XmlUtil
Defined in:
lib/exlibris/primo/review.rb

Overview

Primo Review

Instance Method Summary collapse

Methods included from XmlUtil

included, #to_hash, #to_json, #to_xml

Methods included from WriteAttributes

#write_attributes

Methods included from Namespaces

included

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) ⇒ Review

Returns a new instance of Review.



12
13
14
15
# File 'lib/exlibris/primo/review.rb', line 12

def initialize *args
  @raw_xml = args.last.delete(:raw_xml)
  super
end

Instance Method Details

#allow_user_name?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/exlibris/primo/review.rb', line 41

def allow_user_name?
  @allow_user_name = (xml.root.at_xpath("//allowUserName").inner_text.eql? "true")
end

#ratingObject



25
26
27
# File 'lib/exlibris/primo/review.rb', line 25

def rating
  @rating = xml.root.at_xpath("//rating").inner_text
end

#record_idObject



21
22
23
# File 'lib/exlibris/primo/review.rb', line 21

def record_id
  @record_id = xml.root.at_xpath("//docId").inner_text
end

#statusObject



29
30
31
# File 'lib/exlibris/primo/review.rb', line 29

def status
  @status = xml.root.at_xpath("//status").inner_text
end

#user_display_nameObject



37
38
39
# File 'lib/exlibris/primo/review.rb', line 37

def user_display_name
  @user_display_name = xml.root.at_xpath("//userDisplayName").inner_text
end

#user_idObject



17
18
19
# File 'lib/exlibris/primo/review.rb', line 17

def user_id
  @user_id = xml.root.at_xpath("//userId").inner_text
end

#valueObject



33
34
35
# File 'lib/exlibris/primo/review.rb', line 33

def value
  @value = xml.root.at_xpath("//value").inner_text
end