lib/kentaa/api/resources/resource.rb in kentaa-api-0.7.2 vs lib/kentaa/api/resources/resource.rb in kentaa-api-0.8.0

- old
+ new

@@ -24,10 +24,14 @@ @id = data.fetch(:id) if data.key?(:id) self end + def create(attributes) + save(attributes) + end + def save(attributes) if id @response = update_resource(attributes) else @response = create_resource(attributes) @@ -51,14 +55,14 @@ Time.parse(data[:updated_at]) if data[:updated_at] end private - def create_resource + def create_resource(_attributes) raise NotImplementedError end - def update_resource + def update_resource(_attributes) raise NotImplementedError end def delete_resource raise NotImplementedError