Class: FieldView::Boundary
- Inherits:
-
Object
- Object
- FieldView::Boundary
- Defined in:
- lib/fieldview/boundary.rb
Instance Attribute Summary collapse
-
#area ⇒ Object
Returns the value of attribute area.
-
#centroid ⇒ Object
Returns the value of attribute centroid.
-
#geometry ⇒ Object
Returns the value of attribute geometry.
-
#id ⇒ Object
Returns the value of attribute id.
-
#units ⇒ Object
Returns the value of attribute units.
Instance Method Summary collapse
-
#initialize(json_object) ⇒ Boundary
constructor
A new instance of Boundary.
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
#area ⇒ Object
Returns the value of attribute area.
3 4 5 |
# File 'lib/fieldview/boundary.rb', line 3 def area @area end |
#centroid ⇒ Object
Returns the value of attribute centroid.
3 4 5 |
# File 'lib/fieldview/boundary.rb', line 3 def centroid @centroid end |
#geometry ⇒ Object
Returns the value of attribute geometry.
3 4 5 |
# File 'lib/fieldview/boundary.rb', line 3 def geometry @geometry end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/fieldview/boundary.rb', line 3 def id @id end |
#units ⇒ Object
Returns the value of attribute units.
3 4 5 |
# File 'lib/fieldview/boundary.rb', line 3 def units @units end |