lib/pdfmonkey/document.rb in pdfmonkey-0.1.0 vs lib/pdfmonkey/document.rb in pdfmonkey-0.2.0
- old
+ new
@@ -12,19 +12,20 @@
app_id
checksum
created_at
document_template_id
download_url
+ errors
id
meta
payload
preview_url
status
updated_at
].freeze
- COMPLETE_STATUSES = %w[failure success].freeze
+ COMPLETE_STATUSES = %w[error failure success].freeze
COLLECTION = 'documents'
MEMBER = 'document'
attr_reader :attributes
def_delegators :attributes, *ATTRIBUTES
@@ -55,10 +56,13 @@
update(attributes)
self
end
def to_json
- { document: attributes.to_h }.to_json
+ attrs = attributes.to_h
+ attrs.delete(:errors)
+
+ { document: attrs }.to_json
end
private def save
attributes = adapter.call(:post, self)
update(attributes)