module Aspire::Object::ResourceShortcutsMixin
Shortcut methods
Public Instance Methods
Returns the title of the journal article associated with this resource @return [String, nil] the journal article title or nil if not applicable
# File lib/aspire/object/resource.rb, line 72 def article_title part_title_by_type('Article') end
Returns the title of the book associated with this resource @return [String, nil] the book title or nil if not applicable
# File lib/aspire/object/resource.rb, line 78 def book_title part_of_title_by_type('Book') end
Returns the title of the book chapter associated with this resource @return [String, nil] the book chapter title or nil if not applicable
# File lib/aspire/object/resource.rb, line 84 def chapter_title part_title_by_type('Chapter') end
Returns the resource title as expected by the Alma reading list loader (Article = article title, book = book title, other = resource title) @return [String] the citation title
# File lib/aspire/object/resource.rb, line 91 def citation_title article_title || book_title || title end
Returns the title of the journal associated with this resource @return [String, nil] the journal title or nil if not applicable
# File lib/aspire/object/resource.rb, line 97 def journal_title part_of_title_by_type('Journal') end
Returns the title of the parent resource (book, journal etc.) @return [String] the title of the parent resource
# File lib/aspire/object/resource.rb, line 103 def part_of_title is_part_of ? is_part_of.title : nil end
Returns the title of the parent resource (book, journal etc.) @return [String] the title of the parent resource
# File lib/aspire/object/resource.rb, line 109 def part_of_title_by_type(res_type) return title if type == res_type return is_part_of.title if is_part_of && is_part_of.type == res_type nil end
Returns the title of the part (book chapter, journal article etc.) @return [String] the title of the part
# File lib/aspire/object/resource.rb, line 117 def part_title has_part ? has_part.title : nil end
Returns the title of the part @param res_type [String] the type of the resource @return [String] the title of the part
# File lib/aspire/object/resource.rb, line 124 def part_title_by_type(res_type) return title if type == res_type return has_part.title if has_part && has_part.type == res_type nil end