Class: FieldView::Boundary

Inherits:
Object
  • Object
show all
Defined in:
lib/fieldview/boundary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_object) ⇒ Boundary

Returns a new instance of Boundary.



4
5
6
7
8
9
10
# File 'lib/fieldview/boundary.rb', line 4

def initialize(json_object)
  self.id = json_object[:id]
  self.area = json_object[:properties][:area][:q]
  self.units = json_object[:properties][:area][:u]
  self.centroid = Feature.new(json_object[:properties][:centroid])
  self.geometry = Feature.new(json_object[:geometry])
end

Instance Attribute Details

#areaObject

Returns the value of attribute area.



3
4
5
# File 'lib/fieldview/boundary.rb', line 3

def area
  @area
end

#centroidObject

Returns the value of attribute centroid.



3
4
5
# File 'lib/fieldview/boundary.rb', line 3

def centroid
  @centroid
end

#geometryObject

Returns the value of attribute geometry.



3
4
5
# File 'lib/fieldview/boundary.rb', line 3

def geometry
  @geometry
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/fieldview/boundary.rb', line 3

def id
  @id
end

#unitsObject

Returns the value of attribute units.



3
4
5
# File 'lib/fieldview/boundary.rb', line 3

def units
  @units
end