Class: Pliney::MachO::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/pliney/macho.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(f) ⇒ Reader

Returns a new instance of Reader.



144
145
146
147
# File 'lib/pliney/macho.rb', line 144

def initialize(f)
    @fh = f
    @startpos = @fh.pos
end

Instance Attribute Details

#fhObject (readonly)

Returns the value of attribute fh.



136
137
138
# File 'lib/pliney/macho.rb', line 136

def fh
  @fh
end

#startposObject (readonly)

Returns the value of attribute startpos.



136
137
138
# File 'lib/pliney/macho.rb', line 136

def startpos
  @startpos
end

Class Method Details

.parse(f) ⇒ Object



138
139
140
141
142
# File 'lib/pliney/macho.rb', line 138

def self.parse(f)
    ob = new(f)
    ob.parse()
    return ob
end

Instance Method Details

#parseObject



149
150
151
# File 'lib/pliney/macho.rb', line 149

def parse()
    @fh.pos = @startpos
end

#rewindObject



153
154
155
# File 'lib/pliney/macho.rb', line 153

def rewind()
    @fh.pos = @startpos
end