Class: QuickrouteJpegParser

Inherits:
Object
  • Object
show all
Includes:
BinData
Defined in:
lib/quickroute_jpeg_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, calculate) ⇒ QuickrouteJpegParser

Returns a new instance of QuickrouteJpegParser.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/quickroute_jpeg_parser.rb', line 20

def initialize(filename, calculate)
  @map_corner_positions = {}
  @image_corner_positions = {}

  start_time = Time.now

  data = fetch_data_from(filename)

  if !data.empty?
    process_data(data)
    calculate_data if calculate
  end

  end_time = Time.now
  @execution_time = end_time - start_time
end

Instance Attribute Details

#image_corner_positionsObject (readonly)

Returns the value of attribute image_corner_positions.



17
18
19
# File 'lib/quickroute_jpeg_parser.rb', line 17

def image_corner_positions
  @image_corner_positions
end

#map_corner_positionsObject (readonly)

Returns the value of attribute map_corner_positions.



17
18
19
# File 'lib/quickroute_jpeg_parser.rb', line 17

def map_corner_positions
  @map_corner_positions
end

#map_location_and_size_in_pixelsObject (readonly)

Returns the value of attribute map_location_and_size_in_pixels.



17
18
19
# File 'lib/quickroute_jpeg_parser.rb', line 17

def map_location_and_size_in_pixels
  @map_location_and_size_in_pixels
end

#sessionsObject (readonly)

Returns the value of attribute sessions.



17
18
19
# File 'lib/quickroute_jpeg_parser.rb', line 17

def sessions
  @sessions
end

#versionObject (readonly)

Returns the value of attribute version.



17
18
19
# File 'lib/quickroute_jpeg_parser.rb', line 17

def version
  @version
end