Class: Rubytus::Info

Inherits:
Hash
  • Object
show all
Defined in:
lib/rubytus/info.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Info

Returns a new instance of Info.



5
6
7
8
9
# File 'lib/rubytus/info.rb', line 5

def initialize(args = {})
  self['Offset']      = args[:offset]       || 0
  self['FinalLength'] = args[:final_length] || 0
  self['Meta']        = args[:meta]         || nil
end

Instance Method Details

#final_lengthObject



23
24
25
# File 'lib/rubytus/info.rb', line 23

def final_length
  self['FinalLength']
end

#final_length=(value) ⇒ Object



19
20
21
# File 'lib/rubytus/info.rb', line 19

def final_length=(value)
  self['FinalLength'] = value.to_i
end

#offsetObject



15
16
17
# File 'lib/rubytus/info.rb', line 15

def offset
  self['Offset']
end

#offset=(value) ⇒ Object



11
12
13
# File 'lib/rubytus/info.rb', line 11

def offset=(value)
  self['Offset'] = value.to_i
end

#remaining_lengthObject



27
28
29
# File 'lib/rubytus/info.rb', line 27

def remaining_length
  final_length - offset
end