Class: MyJohnDeere::OrganizationOwnedResource
- Inherits:
-
SingleResource
- Object
- Requestable
- SingleResource
- MyJohnDeere::OrganizationOwnedResource
- Defined in:
- lib/myjohndeere/organization_owned_resource.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
Attributes inherited from SingleResource
Attributes inherited from Requestable
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json_object, access_token = nil) ⇒ OrganizationOwnedResource
constructor
A new instance of 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) ⇒ 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_id ⇒ Object
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
.owning_organization_link_item(organization_id) ⇒ Object
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 |