Class: MyJohnDeere::Boundary
- Inherits:
-
OrganizationOwnedResource
- Object
- Requestable
- SingleResource
- OrganizationOwnedResource
- MyJohnDeere::Boundary
- Defined in:
- lib/myjohndeere/boundary.rb
Instance Attribute Summary collapse
-
#field_id ⇒ Object
Returns the value of attribute field_id.
Attributes inherited from OrganizationOwnedResource
Attributes inherited from SingleResource
Attributes inherited from Requestable
Instance Method Summary collapse
-
#initialize(json_object, access_token = nil, field_id = nil) ⇒ Boundary
constructor
A new instance of Boundary.
Methods inherited from OrganizationOwnedResource
Methods included from JSONAttributes
Methods included from RESTMethods
Methods inherited from Requestable
#extract_link_with_rel_from_list, get_created_id_from_response_headers
Constructor Details
#initialize(json_object, access_token = nil, field_id = nil) ⇒ Boundary
Returns a new instance of Boundary.
9 10 11 12 13 14 15 16 |
# File 'lib/myjohndeere/boundary.rb', line 9 def initialize(json_object, access_token = nil, field_id = nil) super(json_object, access_token) self.field_id = field_id self.active = self.active.to_s.downcase == "true" self.multipolygons = json_object["multipolygons"] # This doesn't exist currently, not sure why self.field_id ||= extract_link_with_rel_from_list("fields", /\/(\d+)\/(.+?)\/fields\Z/) end |
Instance Attribute Details
#field_id ⇒ Object
Returns the value of attribute field_id.
7 8 9 |
# File 'lib/myjohndeere/boundary.rb', line 7 def field_id @field_id end |