indianize 1.3 → 1.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.
- checksums.yaml +4 -4
- data/lib/indianize.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb6795a68f8a55a3088876d4ab81092d33b0f06d2e8385225014b61fad8ae222
|
4
|
+
data.tar.gz: 917c9e5ebe96e37e4f8fe23a3f60ad976b01bc96057b96c42ba3331b453ef70d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc8d6adc678c6a5c4a73212d1ca4acb8afe573277dbe4333d302b0b1b31786f7da45682af692ee0f65a2e6bcb4eb5cb8fe8c3a3462176c1e6a6af7c8b090f565
|
7
|
+
data.tar.gz: 196c2f27692acdb8bd744c5b5eac2da85833613b77b154a85ce353666ebb4a28d4d99d476914b50894541f06ab62efd435db86fb3ab477e70f9612f4b757c14e
|
data/lib/indianize.rb
CHANGED
@@ -34,6 +34,14 @@ class Indianize
|
|
34
34
|
1 => "one"
|
35
35
|
}
|
36
36
|
|
37
|
+
@states_array = ["Andaman and Nicobar Islands", "Andhra Pradesh", "Arunachal Pradesh", "Assam",
|
38
|
+
"Bihar", "Chandigarh", "Chhattisgarh", "Dadra and Nagar Haveli", "Daman & Diu",
|
39
|
+
"Delhi", "Goa", "Gujarat", "Haryana", "Himachal Pradesh", "Jammu & Kashmir",
|
40
|
+
"Jharkhand", "Karnataka", "Kerala", "Lakshadweep", "Madhya Pradesh", "Maharashtra",
|
41
|
+
"Manipur", "Meghalaya", "Mizoram", "Nagaland", "Odisha", "Puducherry", "Punjab",
|
42
|
+
"Rajasthan", "Sikkim", "Tamil Nadu", "Telangana", "Tripura", "Uttar Pradesh",
|
43
|
+
"Uttarakhand", "West Bengal"]
|
44
|
+
|
37
45
|
def self.to_number(value)
|
38
46
|
"₹ " + value.round.to_s.gsub(/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/, "\\1,")
|
39
47
|
end
|
@@ -56,4 +64,18 @@ class Indianize
|
|
56
64
|
end
|
57
65
|
end
|
58
66
|
end
|
67
|
+
|
68
|
+
# states
|
69
|
+
def self.states
|
70
|
+
@states_array
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.state_search(query)
|
74
|
+
result = []
|
75
|
+
@states_array.each do |x|
|
76
|
+
result << x if x.downcase.include?(query)
|
77
|
+
end
|
78
|
+
return result
|
79
|
+
end
|
80
|
+
|
59
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: indianize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Himanshu G.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Convert numbers to Indian currency numbering system with seperators,
|
14
14
|
in numeric and alphabetical formats.
|