Class: LibPtgBox::Work

Inherits:
Object
  • Object
show all
Defined in:
app/modules/lib_ptg_box/work.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product, kbart) ⇒ Work

Returns a new instance of Work


7
8
9
10
11
# File 'app/modules/lib_ptg_box/work.rb', line 7

def initialize(product, kbart)
  @product = product
  @kbart = kbart
  @doi = kbart.doi
end

Instance Attribute Details

#doiObject (readonly)

Returns the value of attribute doi


5
6
7
# File 'app/modules/lib_ptg_box/work.rb', line 5

def doi
  @doi
end

Instance Method Details

#marcObject


17
18
19
# File 'app/modules/lib_ptg_box/work.rb', line 17

def marc
  @marc ||= @product.product_family.catalog.marc(@doi)
end

#marc?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'app/modules/lib_ptg_box/work.rb', line 13

def marc?
  !!marc # rubocop:disable Style/DoubleNegation
end