Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efd3116
commit 3272d4a
Showing
6 changed files
with
35 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
insightly (0.2.6) | ||
insightly (0.2.7) | ||
activesupport (> 3) | ||
builder (>= 2.0.0) | ||
i18n (> 0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
module Insightly | ||
module AddressHelper | ||
def addresses | ||
return [] if !@data["ADDRESSES"] | ||
@data["ADDRESSES"].collect {|a| Insightly::Address.build(a)} | ||
end | ||
def addresses=(list) | ||
@data["ADDRESSES"] = list.collect {|a| a.remote_data} | ||
end | ||
def add_address(address) | ||
@data["ADDRESSES"] ||= [] | ||
@data["ADDRESSES"].each do |a| | ||
if address.same_address?(Insightly::Address.build(a)) | ||
@data["ADDRESSES"] ||= [] | ||
@data["ADDRESSES"].collect { |a| Insightly::Address.build(a) } | ||
end | ||
|
||
return false | ||
end | ||
end | ||
@data["ADDRESSES"] << address.remote_data | ||
true | ||
end | ||
def addresses=(list) | ||
@data["ADDRESSES"] = list.collect { |a| a.remote_data } | ||
end | ||
|
||
def add_address(address) | ||
@data["ADDRESSES"] ||= [] | ||
@data["ADDRESSES"].each do |a| | ||
if address.same_address?(Insightly::Address.build(a)) | ||
|
||
return false | ||
end | ||
end | ||
@data["ADDRESSES"] << address.remote_data | ||
true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
module Insightly | ||
module ContactInfoHelper | ||
def contact_infos | ||
return [] if !@data["CONTACTINFOS"] | ||
@data["CONTACTINFOS"].collect {|a| Insightly::ContactInfo.build(a)} | ||
end | ||
def contact_infos=(list) | ||
@data["CONTACTINFOS"] = list.collect {|a| a.remote_data} | ||
end | ||
def add_contact_info(contact_info) | ||
@data["CONTACTINFOS"] ||= [] | ||
@data["CONTACTINFOS"] << contact_info.remote_data | ||
true | ||
end | ||
@data["CONTACTINFOS"] ||= [] | ||
@data["CONTACTINFOS"].collect { |a| Insightly::ContactInfo.build(a) } | ||
end | ||
|
||
def contact_infos=(list) | ||
@data["CONTACTINFOS"] = list.collect { |a| a.remote_data } | ||
end | ||
|
||
def add_contact_info(contact_info) | ||
@data["CONTACTINFOS"] ||= [] | ||
@data["CONTACTINFOS"] << contact_info.remote_data | ||
true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters