Class: VLC360::Work
- Includes:
- APIOperations::Save, APIResource
- Defined in:
- lib/vlc360/work.rb
Constant Summary collapse
- SAVE_URL =
'/api/customerPortalWebServices/work'
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Work
constructor
A new instance of Work.
- #persisted? ⇒ Boolean
- #process_response(data) ⇒ Object
Methods included from APIOperations::Save
Methods included from APIResource
Methods inherited from Resource
attributes, nested_resource, nested_resources, new_from_hash, #set_attributes, #to_hash, #valid?
Constructor Details
#initialize(attributes = {}) ⇒ Work
Returns a new instance of Work.
15 16 17 18 19 |
# File 'lib/vlc360/work.rb', line 15 def initialize(attributes = {}) @id = -1 super end |
Instance Method Details
#persisted? ⇒ Boolean
21 22 23 |
# File 'lib/vlc360/work.rb', line 21 def persisted? @id != -1 end |
#process_response(data) ⇒ Object
25 26 27 28 29 |
# File 'lib/vlc360/work.rb', line 25 def process_response(data) super(data).tap do |result| @id = data.parsed_response['ServiceID'] if result end end |