Class: MyJohnDeere::SingleResource
- Inherits:
-
Requestable
- Object
- Requestable
- MyJohnDeere::SingleResource
- Includes:
- JSONAttributes, RESTMethods
- Defined in:
- lib/myjohndeere/single_resource.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#deleted ⇒ Object
Returns the value of attribute deleted.
Attributes inherited from Requestable
Instance Method Summary collapse
-
#initialize(json_object, access_token = nil) ⇒ SingleResource
constructor
A new instance of SingleResource.
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) ⇒ 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
#deleted ⇒ Object
Returns the value of attribute deleted.
5 6 7 |
# File 'lib/myjohndeere/single_resource.rb', line 5 def deleted @deleted end |