Class: XABA::Manifest::AssemblyInfo
- Inherits:
-
Object
- Object
- XABA::Manifest::AssemblyInfo
- Defined in:
- lib/xaba/manifest.rb
Instance Attribute Summary collapse
-
#blob_id ⇒ Object
Returns the value of attribute blob_id.
-
#blob_idx ⇒ Object
Returns the value of attribute blob_idx.
-
#hash32 ⇒ Object
Returns the value of attribute hash32.
-
#hash64 ⇒ Object
Returns the value of attribute hash64.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(hash32, hash64, blob_id, blob_idx, name) ⇒ AssemblyInfo
constructor
A new instance of AssemblyInfo.
- #inspect ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(hash32, hash64, blob_id, blob_idx, name) ⇒ AssemblyInfo
Returns a new instance of AssemblyInfo.
10 11 12 13 14 15 16 17 |
# File 'lib/xaba/manifest.rb', line 10 def initialize(hash32, hash64, blob_id, blob_idx, name) @hash32 = hash32.to_i(16) @hash64 = hash64.to_i(16) @blob_id = blob_id.to_i @blob_idx = blob_idx.to_i @name = name raise unless valid? end |
Instance Attribute Details
#blob_id ⇒ Object
Returns the value of attribute blob_id.
8 9 10 |
# File 'lib/xaba/manifest.rb', line 8 def blob_id @blob_id end |
#blob_idx ⇒ Object
Returns the value of attribute blob_idx.
8 9 10 |
# File 'lib/xaba/manifest.rb', line 8 def blob_idx @blob_idx end |
#hash32 ⇒ Object
Returns the value of attribute hash32.
8 9 10 |
# File 'lib/xaba/manifest.rb', line 8 def hash32 @hash32 end |
#hash64 ⇒ Object
Returns the value of attribute hash64.
8 9 10 |
# File 'lib/xaba/manifest.rb', line 8 def hash64 @hash64 end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/xaba/manifest.rb', line 8 def name @name end |
Instance Method Details
#inspect ⇒ Object
19 20 21 22 |
# File 'lib/xaba/manifest.rb', line 19 def inspect format("<AssemblyInfo hash32=%08x hash64=%016x blob_id=%d blob_idx=%3d name=%s>", hash32, hash64, blob_id, blob_idx, name.inspect) end |
#valid? ⇒ Boolean
24 25 26 |
# File 'lib/xaba/manifest.rb', line 24 def valid? XXhash.xxh32(name) == hash32 && XXhash.xxh64(name) == hash64 end |