Class: MyJohnDeere::SingleResource

Inherits:
Requestable show all
Includes:
JSONAttributes, RESTMethods
Defined in:
lib/myjohndeere/single_resource.rb

Direct Known Subclasses

Organization, OrganizationOwnedResource

Instance Attribute Summary collapse

Attributes inherited from Requestable

#access_token, #links

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

Returns a new instance of SingleResource.



7
8
9
10
11
# File 'lib/myjohndeere/single_resource.rb', line 7

def initialize(json_object, access_token = nil)
  super(json_object, access_token)
  setup_attributes(json_object)
  self.deleted = self.links.any? { |link_hash| link_hash["rel"] == "delete" }
end

Instance Attribute Details

#deletedObject

Returns the value of attribute deleted.



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

def deleted
  @deleted
end