class Rupert::RPM::Index
Attributes
store[W]
Public Class Methods
new(entries=[], store=nil)
click to toggle source
Initializes a new signature index, given the header’s entries and the store containing actual data.
@param entries [Array] a list of
{Rupert::RPM::Entry}, or optionally a single {Rupert::RPM::Entry} not included in any array
@param store [IO] raw store containing data pointed by entries
# File lib/rupert/rpm/index.rb, line 16 def initialize(entries=[], store=nil) @entries = index list_of entries @store = store end
Public Instance Methods
add(entry)
click to toggle source
Adds an entry to the index.
@param entry [Rupert::RPM::Entry] new entry to add to the index
# File lib/rupert/rpm/index.rb, line 34 def add(entry) @entries[entry.tag] = entry end
get(tag)
click to toggle source
Retrieves data pointed by given tag.
@param tag [Fixnum] data type @return [Object] data associated to given tag, with variable format
depending on how it's stored (see {Rupert::RPM::Entry#resolve})
# File lib/rupert/rpm/index.rb, line 27 def get(tag) @entries[tag].resolve(@store) end