Class: Pliney::AppleCodeSignature::Blob
- Inherits:
-
Object
- Object
- Pliney::AppleCodeSignature::Blob
- Defined in:
- lib/pliney/apple_code_signature.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Magic
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#magic ⇒ Object
readonly
Returns the value of attribute magic.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(magic, data) {|_self| ... } ⇒ Blob
constructor
A new instance of Blob.
- #parse ⇒ Object
Constructor Details
#initialize(magic, data) {|_self| ... } ⇒ Blob
Returns a new instance of Blob.
19 20 21 22 23 24 |
# File 'lib/pliney/apple_code_signature.rb', line 19 def initialize(magic, data) @magic = Magic.new(magic) @input = data.is_a?(StringStream)? data : StringStream.new(data) @base = @input.pos-4 yield self if block_given? end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
17 18 19 |
# File 'lib/pliney/apple_code_signature.rb', line 17 def input @input end |
#magic ⇒ Object (readonly)
Returns the value of attribute magic.
17 18 19 |
# File 'lib/pliney/apple_code_signature.rb', line 17 def magic @magic end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
17 18 19 |
# File 'lib/pliney/apple_code_signature.rb', line 17 def size @size end |
Instance Method Details
#parse ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/pliney/apple_code_signature.rb', line 26 def parse if @input @size = input.read_uint32 yield end @input=nil return self end |