Class: Marcxella::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/marcxella/collection.rb

Overview

Wrapper for a collection element, which contains 0 or more record

elements

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Collection

Returns a new instance of Collection.

Since:

  • 0.1.0



6
7
8
# File 'lib/marcxella/collection.rb', line 6

def initialize(node)
  @node = node
end

Instance Method Details

#recordsArray<Record>

Returns the records in the container.

Returns:

  • (Array<Record>)

    the records in the container

Since:

  • 0.1.0



11
12
13
# File 'lib/marcxella/collection.rb', line 11

def records
  @node.css('record').map{|r| Record.new(r)}
end