Class: MyJohnDeere::Boundary

Inherits:
OrganizationOwnedResource show all
Defined in:
lib/myjohndeere/boundary.rb

Instance Attribute Summary collapse

Attributes inherited from OrganizationOwnedResource

#organization_id

Attributes inherited from SingleResource

#deleted

Attributes inherited from Requestable

#access_token, #links

Instance Method Summary collapse

Methods inherited from OrganizationOwnedResource

owning_organization_link_item

Methods included from JSONAttributes

included

Methods included from RESTMethods

included

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_idObject

Returns the value of attribute field_id.



7
8
9
# File 'lib/myjohndeere/boundary.rb', line 7

def field_id
  @field_id
end