lib/netsuite/support/actions.rb in netsuite-0.0.26 vs lib/netsuite/support/actions.rb in netsuite-0.0.27

- old
+ new

@@ -24,10 +24,12 @@ define_get(class_module) when :add define_add(instance_module) when :initialize define_initialize(class_module) + when :delete + define_delete(instance_module) else raise "Unknown action: #{action.inspect}" end end @@ -67,9 +69,18 @@ if response.success? new(response.body) else raise InitializationError, "#{self}.initialize with #{object} failed." end + end + end + end + + def define_delete(instance_module) + instance_module.module_eval do + define_method :delete do + response = NetSuite::Actions::Delete.call(self) + response.success? end end end end