Class: CartoCSSHelper::VisualDiff::FileDataSource

Inherits:
Object
  • Object
show all
Defined in:
lib/cartocss_helper/visualise_changes_image_generation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(latitude, longitude, download_bbox_size, filename) ⇒ FileDataSource

Returns a new instance of FileDataSource.



113
114
115
116
117
118
119
# File 'lib/cartocss_helper/visualise_changes_image_generation.rb', line 113

def initialize(latitude, longitude, download_bbox_size, filename)
  @download_bbox_size = download_bbox_size
  @latitude = latitude
  @longitude = longitude
  @data_filename = filename
  @loaded = false
end

Instance Attribute Details

#data_filenameObject (readonly)

Returns the value of attribute data_filename.



112
113
114
# File 'lib/cartocss_helper/visualise_changes_image_generation.rb', line 112

def data_filename
  @data_filename
end

#download_bbox_sizeObject (readonly)

Returns the value of attribute download_bbox_size.



112
113
114
# File 'lib/cartocss_helper/visualise_changes_image_generation.rb', line 112

def download_bbox_size
  @download_bbox_size
end

Instance Method Details

#get_timestampObject



129
130
131
# File 'lib/cartocss_helper/visualise_changes_image_generation.rb', line 129

def get_timestamp
  return GenericCachedDownloader.new.get_cache_timestamp(@data_filename)
end

#loadObject



121
122
123
124
125
126
127
# File 'lib/cartocss_helper/visualise_changes_image_generation.rb', line 121

def load
  unless @loaded
    DataFileLoader.load_data_into_database(@data_filename)
    puts "\tgenerating images"
    @loaded = true
  end
end