module Conekta module APIOperations module Create module ClassMethods def create_member(member, params={}, api_key=nil) path = "/customers/#{self.id}/#{member}" response, api_key = Conekta.request(:post, path, api_key, params) obj = Util.convert_to_conekta_object(response, api_key) if obj.class == ConektaObject count = self.cards.count self.cards[count] = obj else self.subscription = obj end obj end def create(params={}, api_key=nil) response, api_key = Conekta.request(:post, self.url, api_key, params) Util.convert_to_conekta_object(response, api_key) end end def self.included(base) base.extend(ClassMethods) end end end end