Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
clean up Create a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Feb 20, 2009
1 parent 8e09a22 commit 728e420
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/campaign_monitor/list.rb
Expand Up @@ -94,10 +94,9 @@ def Delete
end

def Create
raw=cm_client.List_Create(@attributes)
@result=Result.new(raw)
self.id = raw["__content__"] if raw["__content__"]
id ? true : false
@result=Result.new(cm_client.List_Create(@attributes))
self.id = @result.content if @result.success?
@result.success?
end

# Example
Expand Down
4 changes: 4 additions & 0 deletions lib/campaign_monitor/result.rb
Expand Up @@ -17,6 +17,10 @@ def failed?
!succeeded?
end

def content
raw["__content__"]
end

alias :succeeded? :success?
alias :failure? :failed?

Expand Down

0 comments on commit 728e420

Please sign in to comment.