Class: Relaton::Bipm::ItemData

Inherits:
Bib::ItemData
  • Object
show all
Defined in:
lib/relaton/bipm/item_data.rb

Instance Method Summary collapse

Instance Method Details

#deep_cloneObject



6
7
8
# File 'lib/relaton/bipm/item_data.rb', line 6

def deep_clone
  Item.from_yaml Item.to_yaml(self)
end

#to_asciibibObject



32
33
34
# File 'lib/relaton/bipm/item_data.rb', line 32

def to_asciibib
  Converter::Asciibib.from_item(self)
end

#to_json(**opts) ⇒ Object



26
27
28
29
30
# File 'lib/relaton/bipm/item_data.rb', line 26

def to_json(**opts)
  add_notes opts[:note] do
    Item.to_json(self)
  end
end

#to_xml(bibdata: false, **opts) ⇒ Object

def create_relation(**args)

Relation.new(**args)

end



14
15
16
17
18
# File 'lib/relaton/bipm/item_data.rb', line 14

def to_xml(bibdata: false, **opts)
  add_notes opts[:note] do
    bibdata ? Bibdata.to_xml(self) : Bibitem.to_xml(self)
  end
end

#to_yaml(**opts) ⇒ Object



20
21
22
23
24
# File 'lib/relaton/bipm/item_data.rb', line 20

def to_yaml(**opts)
  add_notes opts[:note] do
    Item.to_yaml(self)
  end
end