Class: Relaton::Plateau::Cover

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton/plateau/cover.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image) ⇒ Cover

Initialize the Cover object

Parameters:

  • image (RelatonBib::Image)

    image object



12
13
14
# File 'lib/relaton/plateau/cover.rb', line 12

def initialize(image)
  @image = image
end

Instance Attribute Details

#imageRelatonBib::Image (readonly)

Returns:

  • (RelatonBib::Image)


5
6
7
# File 'lib/relaton/plateau/cover.rb', line 5

def image
  @image
end

Instance Method Details

#to_asciibib(prefix = "") ⇒ Object



26
27
28
29
# File 'lib/relaton/plateau/cover.rb', line 26

def to_asciibib(prefix = "")
  pref = prefix.empty? ? "cover" : "#{prefix}.cover"
  image.to_asciibib pref
end

#to_hashObject



22
23
24
# File 'lib/relaton/plateau/cover.rb', line 22

def to_hash
  image.to_hash
end

#to_xml(builder) ⇒ Object



16
17
18
19
20
# File 'lib/relaton/plateau/cover.rb', line 16

def to_xml(builder)
  builder.cover do |b|
    image.to_xml b
  end
end