Class: Coradoc::Document::Bibdata

Inherits:
Object
  • Object
show all
Defined in:
lib/coradoc/document/bibdata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bibdata, options = {}) ⇒ Bibdata

Returns a new instance of Bibdata.



6
7
8
9
# File 'lib/coradoc/document/bibdata.rb', line 6

def initialize(bibdata, options = {})
  @bibdata = bibdata
  @options = options
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/coradoc/document/bibdata.rb', line 4

def data
  @data
end

Instance Method Details

#to_hashObject



15
16
17
18
19
20
21
# File 'lib/coradoc/document/bibdata.rb', line 15

def to_hash
  Hash.new.tap do |hash|
    data.each do |attribute|
      hash[attribute.key.to_s] = attribute.value.to_s.gsub("'", "")
    end
  end
end