zoho_invoice 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/zoho_invoice/base.rb +8 -2
- data/lib/zoho_invoice/version.rb +1 -1
- data/spec/zoho_invoice/base_spec.rb +10 -0
- metadata +2 -2
data/lib/zoho_invoice/base.rb
CHANGED
@@ -107,9 +107,15 @@ module ZohoInvoice
|
|
107
107
|
|
108
108
|
protected
|
109
109
|
|
110
|
-
|
110
|
+
def self.camel_case(str)
|
111
111
|
return str if str !~ /_/ && str =~ /[A-Z]+.*/
|
112
|
-
str.split('_').map
|
112
|
+
str.split('_').map do |e|
|
113
|
+
if e == "id"
|
114
|
+
e.upcase
|
115
|
+
else
|
116
|
+
e.capitalize
|
117
|
+
end
|
118
|
+
end.join
|
113
119
|
end
|
114
120
|
|
115
121
|
def camel_case(str)
|
data/lib/zoho_invoice/version.rb
CHANGED
@@ -77,6 +77,16 @@ describe ZohoInvoice::Base do
|
|
77
77
|
expect(xml.xpath('//TestIt')).to be_empty
|
78
78
|
end
|
79
79
|
|
80
|
+
it "should create id attributes correctly" do
|
81
|
+
@test_obj.something_id = '7890'
|
82
|
+
xml = Nokogiri::XML(@test_obj.to_xml)
|
83
|
+
expect(xml.xpath('//SomethingID').first.text).to eq('7890')
|
84
|
+
|
85
|
+
@test_obj.something_id = nil
|
86
|
+
xml = Nokogiri::XML(@test_obj.to_xml)
|
87
|
+
expect(xml.xpath('//SomethingID')).to be_empty
|
88
|
+
end
|
89
|
+
|
80
90
|
it "should create the associations correctly" do
|
81
91
|
class Thing < Struct.new(:stuff)
|
82
92
|
def to_xml(*args)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zoho_invoice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|