Class: MyJohnDeere::OrganizationOwnedResource

Inherits:
SingleResource show all
Defined in:
lib/myjohndeere/organization_owned_resource.rb

Direct Known Subclasses

Boundary, Field, FileResource, MapLayer, MapLayerSummary

Instance Attribute Summary collapse

Attributes inherited from SingleResource

#deleted

Attributes inherited from Requestable

#access_token, #links

Class Method Summary collapse

Instance Method Summary collapse

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) ⇒ OrganizationOwnedResource

Returns a new instance of OrganizationOwnedResource.



5
6
7
8
# File 'lib/myjohndeere/organization_owned_resource.rb', line 5

def initialize(json_object, access_token = nil)
  super(json_object, access_token)
  self.organization_id = extract_link_with_rel_from_list("owningOrganization", /organizations\/([^\/]+)\Z/)
end

Instance Attribute Details

#organization_idObject

Returns the value of attribute organization_id.



3
4
5
# File 'lib/myjohndeere/organization_owned_resource.rb', line 3

def organization_id
  @organization_id
end

Class Method Details



10
11
12
13
14
15
# File 'lib/myjohndeere/organization_owned_resource.rb', line 10

def self.owning_organization_link_item(organization_id)
  {
    rel: "owningOrganization",
    uri: "#{MyJohnDeere.configuration.endpoint}/organizations/#{organization_id}"
  }
end