Class: Cinii::Item::Book
Instance Attribute Summary collapse
-
#creator ⇒ Object
readonly
Returns the value of attribute creator.
-
#has_part ⇒ Object
readonly
Returns the value of attribute has_part.
-
#is_part ⇒ Object
readonly
Returns the value of attribute is_part.
-
#owner_count ⇒ Object
readonly
Returns the value of attribute owner_count.
-
#publication_date ⇒ Object
readonly
Returns the value of attribute publication_date.
-
#publisher ⇒ Object
readonly
Returns the value of attribute publisher.
Attributes inherited from Base
#date, #id, #link, #see_also, #title, #type
Instance Method Summary collapse
-
#initialize(item) ⇒ Book
constructor
A new instance of Book.
Constructor Details
#initialize(item) ⇒ Book
Returns a new instance of Book.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/cinii/item/book.rb', line 8 def initialize(item) @publisher = item['dc:publisher'] @publication_date = item['prism:publicationDate'] @creator = item['dc:creator'] @is_part = item['dcterms:isPartOf']&.map { |c| { id: c['@id'], title: c['dc:title']} } @has_part = item['dcterms:hasPart']&.map { |c| c['@id'] } @owner_count = item['cinii:ownerCount'] super(item) end |
Instance Attribute Details
#creator ⇒ Object (readonly)
Returns the value of attribute creator.
6 7 8 |
# File 'lib/cinii/item/book.rb', line 6 def creator @creator end |
#has_part ⇒ Object (readonly)
Returns the value of attribute has_part.
6 7 8 |
# File 'lib/cinii/item/book.rb', line 6 def has_part @has_part end |
#is_part ⇒ Object (readonly)
Returns the value of attribute is_part.
6 7 8 |
# File 'lib/cinii/item/book.rb', line 6 def is_part @is_part end |
#owner_count ⇒ Object (readonly)
Returns the value of attribute owner_count.
6 7 8 |
# File 'lib/cinii/item/book.rb', line 6 def owner_count @owner_count end |
#publication_date ⇒ Object (readonly)
Returns the value of attribute publication_date.
6 7 8 |
# File 'lib/cinii/item/book.rb', line 6 def publication_date @publication_date end |
#publisher ⇒ Object (readonly)
Returns the value of attribute publisher.
6 7 8 |
# File 'lib/cinii/item/book.rb', line 6 def publisher @publisher end |