Class: ModsDisplay::Record
- Inherits:
-
Object
- Object
- ModsDisplay::Record
- Defined in:
- app/models/mods_display/record.rb
Instance Attribute Summary collapse
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Record
constructor
A new instance of Record.
- #mods_display_html ⇒ Object
- #mods_record ⇒ Object
Constructor Details
#initialize(xml) ⇒ Record
Returns a new instance of Record.
11 12 13 |
# File 'app/models/mods_display/record.rb', line 11 def initialize(xml) @xml = xml end |
Instance Attribute Details
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
9 10 11 |
# File 'app/models/mods_display/record.rb', line 9 def xml @xml end |
Instance Method Details
#mods_display_html ⇒ Object
21 22 23 24 25 |
# File 'app/models/mods_display/record.rb', line 21 def mods_display_html return unless mods_record ModsDisplay::HTML.new(mods_record) end |
#mods_record ⇒ Object
15 16 17 18 19 |
# File 'app/models/mods_display/record.rb', line 15 def mods_record return if xml.nil? @mods_record ||= Stanford::Mods::Record.new.tap { |mods| mods.from_str(xml) } end |