Class: R4DigitalNZ::MetaData

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/r4digitalnz.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ MetaData

Returns a new instance of MetaData.



140
141
142
143
144
145
146
# File 'lib/r4digitalnz.rb', line 140

def initialize hash
  @objid = hash['mets']['OBJID']
  @profile = hash['mets']['PROFILE']
  @sections = hash['mets']['dmdSec'].collect do |s|
    Section.new s
  end
end

Instance Attribute Details

#objidObject (readonly)

Returns the value of attribute objid.



137
138
139
# File 'lib/r4digitalnz.rb', line 137

def objid
  @objid
end

#profileObject (readonly)

Returns the value of attribute profile.



138
139
140
# File 'lib/r4digitalnz.rb', line 138

def profile
  @profile
end

Instance Method Details

#eachObject



148
149
150
# File 'lib/r4digitalnz.rb', line 148

def each
  @sections.each {|s| yield s}
end

#section(section_id) ⇒ Object



152
153
154
# File 'lib/r4digitalnz.rb', line 152

def section section_id
  self.find {|s| s.id == section_id}
end