Class: Cinii::Item::Book

Inherits:
Base
  • Object
show all
Defined in:
lib/cinii/item/book.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#date, #id, #link, #see_also, #title, #type

Instance Method Summary collapse

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

#creatorObject (readonly)

Returns the value of attribute creator.



6
7
8
# File 'lib/cinii/item/book.rb', line 6

def creator
  @creator
end

#has_partObject (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_partObject (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_countObject (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_dateObject (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

#publisherObject (readonly)

Returns the value of attribute publisher.



6
7
8
# File 'lib/cinii/item/book.rb', line 6

def publisher
  @publisher
end