Class: GeoWorks::VectorGeometryService

Inherits:
Object
  • Object
show all
Defined in:
app/services/geo_works/vector_geometry_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_set, file_path) ⇒ VectorGeometryService

Returns a new instance of VectorGeometryService.



5
6
7
8
# File 'app/services/geo_works/vector_geometry_service.rb', line 5

def initialize(file_set, file_path)
  @file_set = file_set
  @file_path = file_path.gsub('file:', '')
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



3
4
5
# File 'app/services/geo_works/vector_geometry_service.rb', line 3

def file_path
  @file_path
end

#file_setObject (readonly)

Returns the value of attribute file_set.



3
4
5
# File 'app/services/geo_works/vector_geometry_service.rb', line 3

def file_set
  @file_set
end

Instance Method Details

#callObject

Extracts geometry type from display vector and saves value in FileSet.



11
12
13
14
# File 'app/services/geo_works/vector_geometry_service.rb', line 11

def call
  file_set.geometry_type = geometry
  file_set.save!
end