Sha256: 9715bb52eb6aa93765e2e87f9e1a08ceebde40013a9549604c7fab57756ee7ec

Contents?: true

Size: 675 Bytes

Versions: 4

Compression:

Stored size: 675 Bytes

Contents

module Exlibris
  module Primo
    # == Overview
    # Class for handling Primo TOCs from links/linktotoc
    class Toc
      @base_attributes = [ :record_id, :linktotoc, :url, :display,  :notes ]
      class << self; attr_reader :base_attributes end
      def initialize(options={})
        base_attributes = (self.class.base_attributes.nil?) ? 
          Exlibris::Primo::Toc.base_attributes : self.class.base_attributes
        base_attributes.each { |attribute|
          self.class.send(:attr_reader, attribute)
        }
        options.each { |option, value| 
          self.instance_variable_set(('@'+option.to_s).to_sym, value) 
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
exlibris-primo-0.1.5 lib/exlibris/primo/toc.rb
exlibris-primo-0.1.4 lib/exlibris/primo/toc.rb
exlibris-primo-0.1.1 lib/exlibris/primo/toc.rb
exlibris-primo-0.1.0 lib/exlibris/primo/toc.rb