Class: Veryfi::Api::LineItem
- Inherits:
-
Object
- Object
- Veryfi::Api::LineItem
- Defined in:
- lib/veryfi/api/line_item.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #all(document_id, params = {}) ⇒ Object
- #create(document_id, params) ⇒ Object
- #delete(document_id, id) ⇒ Object
- #get(document_id, id, params = {}) ⇒ Object
-
#initialize(request) ⇒ LineItem
constructor
A new instance of LineItem.
- #update(document_id, id, params) ⇒ Object
Constructor Details
#initialize(request) ⇒ LineItem
Returns a new instance of LineItem.
8 9 10 |
# File 'lib/veryfi/api/line_item.rb', line 8 def initialize(request) @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
6 7 8 |
# File 'lib/veryfi/api/line_item.rb', line 6 def request @request end |
Instance Method Details
#all(document_id, params = {}) ⇒ Object
12 13 14 15 |
# File 'lib/veryfi/api/line_item.rb', line 12 def all(document_id, params = {}) response = request.get("/partner/documents/#{document_id}/line-items/", params) response["line_items"] end |
#create(document_id, params) ⇒ Object
17 18 19 |
# File 'lib/veryfi/api/line_item.rb', line 17 def create(document_id, params) request.post("/partner/documents/#{document_id}/line-items/", params) end |
#delete(document_id, id) ⇒ Object
29 30 31 |
# File 'lib/veryfi/api/line_item.rb', line 29 def delete(document_id, id) request.delete("/partner/documents/#{document_id}/line-items/#{id}") end |
#get(document_id, id, params = {}) ⇒ Object
21 22 23 |
# File 'lib/veryfi/api/line_item.rb', line 21 def get(document_id, id, params = {}) request.get("/partner/documents/#{document_id}/line-items/#{id}", params) end |
#update(document_id, id, params) ⇒ Object
25 26 27 |
# File 'lib/veryfi/api/line_item.rb', line 25 def update(document_id, id, params) request.put("/partner/documents/#{document_id}/line-items/#{id}", params) end |