Class: R4DigitalNZ::Section
- Inherits:
-
Object
- Object
- R4DigitalNZ::Section
- Defined in:
- lib/r4digitalnz.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#mdtype ⇒ Object
readonly
Returns the value of attribute mdtype.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Section
constructor
A new instance of Section.
- #inspect ⇒ Object
Constructor Details
#initialize(hash) ⇒ Section
Returns a new instance of Section.
112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/r4digitalnz.rb', line 112 def initialize hash @id = hash['ID'] @mime_type = hash['mdWrap']['MIMETYPE'] @mdtype = hash['mdWrap']['MDTYPE'] hash['mdWrap']['xmlData'].each do |k,v| (class << self; self;end).class_eval do define_method(k.gsub(':', '_').to_sym) { v } end end end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
108 109 110 |
# File 'lib/r4digitalnz.rb', line 108 def id @id end |
#mdtype ⇒ Object (readonly)
Returns the value of attribute mdtype.
110 111 112 |
# File 'lib/r4digitalnz.rb', line 110 def mdtype @mdtype end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
109 110 111 |
# File 'lib/r4digitalnz.rb', line 109 def mime_type @mime_type end |
Instance Method Details
#inspect ⇒ Object
124 125 126 127 128 129 130 131 |
# File 'lib/r4digitalnz.rb', line 124 def inspect out = "#<#R4DigitalNZ::Section:#{self.object_id} " public_methods(false).sort.each do |m| next if m == "inspect" out << ", @#{m}=\"#{send(m.to_sym)}\"" end out << ">" end |