class Px4LogReader::Progress
Attributes
file_size[RW]
Public Class Methods
new( active_file )
click to toggle source
# File lib/px4_log_reader/progress.rb, line 39 def initialize( active_file ) @active_file = active_file active_file.seek( 0, IO::SEEK_END ) @file_size = active_file.pos active_file.seek( 0 ) end
Public Instance Methods
file_offset()
click to toggle source
# File lib/px4_log_reader/progress.rb, line 47 def file_offset @active_file.pos end
percentage()
click to toggle source
# File lib/px4_log_reader/progress.rb, line 51 def percentage return ( file_offset.to_f / @file_size.to_f ) end