lib/billomat/models/base.rb in billomat-0.1.2 vs lib/billomat/models/base.rb in billomat-0.1.3
- old
+ new
@@ -93,9 +93,17 @@
def wrapped_data
{ self.class.resource_name => @data.to_h }
end
##
+ # Returns the object with the right JSON structure
+ #
+ # @return [Hash] The objects data
+ def as_json(options = nil)
+ @data.to_h
+ end
+
+ ##
# All values in the @data hash can be accessed like a 'normal' method
#
# @example
# invoice = Billomat::Models::Invoice.new(invoice_number: '123')
# invoice.invoice_number